diff options
Diffstat (limited to 'main/tests')
53 files changed, 1436 insertions, 293 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding.Refactoring/ResolveNamespaceTests.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding.Refactoring/ResolveNamespaceTests.cs index 2a196603f9..80f5c7aa17 100644 --- a/main/tests/UnitTests/MonoDevelop.CSharpBinding.Refactoring/ResolveNamespaceTests.cs +++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding.Refactoring/ResolveNamespaceTests.cs @@ -49,7 +49,7 @@ namespace MonoDevelop.CSharpBinding.Refactoring var tww = new TestWorkbenchWindow (); var content = new TestViewContent (); - var project = new DotNetAssemblyProject ("C#"); + var project = Services.ProjectService.CreateDotNetProject ("C#"); project.Name = "test"; project.References.Add (new ProjectReference (ReferenceType.Package, "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")); project.References.Add (new ProjectReference (ReferenceType.Package, "System.Core")); diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs index 16270bb7ef..09e4259738 100644 --- a/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs +++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs @@ -394,6 +394,29 @@ namespace MonoDevelop.CSharpBinding CheckOutput (data, "namespace Foo\n{\n\tpublic class Bar\n\t{\n\t\tvoid Test()\r\n\t\t{\r\n\t\t\t/* foo\n\t\t\t * $\n\t\t}\n\t}\n}\n"); } + + /// <summary> + /// Bug 23109 - Semicolon is put at the end of line instead at the position of cursor + /// </summary> + [Test] + public void TestBug23109 () + { + TestGuessSemicolonInsertionOffset ("int i = 400$~ DelayMax / DelayMin; // 1 s", false); + } + + [Test] + public void TestBug23109_CorrectCase () + { + TestGuessSemicolonInsertionOffset ("int i = 400$ DelayMax / DelayMin~ // 1 s"); + } + + [Test] + public void TestBlockComment () + { + TestGuessSemicolonInsertionOffset ("int i = 400$~ DelayMax / DelayMin; /* 1 s", false); + } + + /// <summary> /// Bug 17766 - Decreasing tab on single line bounces back to formatting spot. /// </summary> diff --git a/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs b/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs index 0100ae6584..2b86670596 100644 --- a/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs @@ -28,7 +28,7 @@ using System.Linq; using System.Collections.Generic; using NUnit.Framework; using MonoDevelop.Projects; -using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.NRefactory.TypeSystem; using MonoDevelop.Ide.TypeSystem; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.TypeSystem; @@ -42,44 +42,46 @@ namespace MonoDevelop.Ide.FindInFiles { IAssembly GenerateAssembly(Project project, string code) { - project.Files.Add (new ProjectFile ("test.cs", BuildAction.Compile)); var wrapper = TypeSystemService.LoadProject (project); TypeSystemService.ParseFile ("test.cs", "text/x-csharp", code, wrapper); wrapper.RequestLoad (); do { System.Threading.Thread.Sleep (10); - } while (wrapper.InLoad); - return wrapper.Compilation.MainAssembly; - }
-
- List<IMember> CollectMembers (string code, string typeName, Predicate<IUnresolvedMember> filter1, Predicate<IMember> filter2,
- bool includeOverloads, bool matchDeclaringType)
- {
+ } while (!wrapper.IsLoaded); + var result = wrapper.Compilation.MainAssembly; + return result; + } + + List<IMember> CollectMembers (string code, string typeName, Predicate<IUnresolvedMember> filter1, Predicate<IMember> filter2, + bool includeOverloads, bool matchDeclaringType) + { var fileName = string.Format ("test{0}.csproj", Environment.TickCount); // use a new file name for each test to avoid conflicts var project = new UnknownProject { FileName = fileName }; -
- var solution = new Solution ();
- solution.RootFolder.AddItem (project);
-
- var baseType = GenerateAssembly (project, code).GetTypeDefinition ("", typeName, 0);
-
- var members = baseType.GetMembers (filter1).Concat (baseType.GetConstructors (filter1));
- if (filter2 != null)
- members = members.Where (m => filter2(m));
- return MemberCollector.CollectMembers (solution, members.First (), ReferenceFinder.RefactoryScope.Solution,
- includeOverloads, matchDeclaringType).ToList ();
+ + var solution = new Solution (); + solution.RootFolder.AddItem (project); + + var baseType = GenerateAssembly (project, code).GetTypeDefinition ("", typeName, 0); + + var members = baseType.GetMembers (filter1).Concat (baseType.GetConstructors (filter1)); + if (filter2 != null) + members = members.Where (m => filter2(m)); + var result = MemberCollector.CollectMembers (solution, members.First (), ReferenceFinder.RefactoryScope.Solution, + includeOverloads, matchDeclaringType).ToList (); + TypeSystemService.UnloadProject (project, true); + return result; } - List<IMember> CollectMembers (string code, string typeName, string memberName, Predicate<IMember> searchMemberFilter,
+ List<IMember> CollectMembers (string code, string typeName, string memberName, Predicate<IMember> searchMemberFilter, bool includeOverloads, bool matchDeclaringType) - {
- return CollectMembers (code, typeName, m => m.Name == memberName && m.DeclaringTypeDefinition.Name == typeName,
+ { + return CollectMembers (code, typeName, m => m.Name == memberName && m.DeclaringTypeDefinition.Name == typeName, searchMemberFilter, includeOverloads, matchDeclaringType); } - void TestCollectMembers (string code, string typeName, string memberName, IEnumerable<Predicate<IMember>> expected,
+ void TestCollectMembers (string code, string typeName, string memberName, IEnumerable<Predicate<IMember>> expected, Predicate<IMember> searchMemberFilter = null, bool includeOverloads = true, bool matchDeclaringType = false) - {
+ { var result = CollectMembers (code, typeName, memberName, searchMemberFilter, includeOverloads, matchDeclaringType); VerifyResult (result, expected); } @@ -118,7 +120,7 @@ namespace MonoDevelop.Ide.FindInFiles return m => m.Name == memberName && m.DeclaringType.Name == declaringType && (filter == null || filter (m)); } - [Test]
+ [Test] public void TestMethodOverrides () { var code = @" @@ -144,7 +146,7 @@ class D : A TestCollectMembersForAllTypes (code, memberName, types); } - [Test]
+ [Test] public void TestEventOverrides () { var code = @" @@ -198,7 +200,7 @@ class D : A TestCollectMembersForAllTypes (code, memberName, types); } - [Test]
+ [Test] public void TestSingleInterfaceImpl () { var code = @" @@ -326,7 +328,7 @@ class C : IB TestCollectMembers (code, "IB", memberName, expected3); } - [Test]
+ [Test] public void TestMethodOverloads () { var code = @" @@ -357,7 +359,7 @@ struct B } } - [Test]
+ [Test] public void TestIncludeOverloads () { var code = @" @@ -395,7 +397,7 @@ class D : A } - [Test]
+ [Test] public void TestExcludeOverloads () { var code = @" @@ -441,7 +443,7 @@ class D : A } - [Test]
+ [Test] public void TestInterfacePlusOverrides () { string code = @" @@ -509,37 +511,38 @@ class D : B, IA, IB { } var result3 = MemberCollector.GetBaseTypes (new [] {A, B, C, D, IA, IB}).ToList (); VerifyResult (result3, new Predicate<ITypeDefinition>[] {t => t == A, t => t == IA, t => t == IB}); - }
-
- [Test]
- public void TestMatchDeclaringType ()
- {
- var code = @"
-class A
-{
- public virtual void Method() { };
- public void Method(int i) { };
-}
-class B : A
-{
- public override void Method() { };
-}";
- var memberName = "Method";
- var emptyParam = new string [] { };
- var intParam = new [] { "Int32" };
-
- var paramList = new [] { emptyParam, intParam };
- var expected1 = paramList.Select (p => GetMemberFilter ("A", memberName, m => MatchParameters (m, p))).ToList ();
- foreach (var filter in expected1)
- TestCollectMembers (code, "A", memberName, expected1, filter, true, true);
-
- var expected2 = new List<Predicate<IMember>> { GetMemberFilter ("A", memberName, m => MatchParameters (m, emptyParam)) };
- TestCollectMembers (code, "A", memberName, expected2, expected2 [0], false, true);
-
- var expected3 = new List<Predicate<IMember>> { GetMemberFilter ("B", memberName, m => MatchParameters (m, emptyParam)) };
- TestCollectMembers (code, "B", memberName, expected3, expected3 [0], false, true);
- }
-
+ TypeSystemService.UnloadProject (project, true); + } + + [Test] + public void TestMatchDeclaringType () + { + var code = @" +class A +{ + public virtual void Method() { }; + public void Method(int i) { }; +} +class B : A +{ + public override void Method() { }; +}"; + var memberName = "Method"; + var emptyParam = new string [] { }; + var intParam = new [] { "Int32" }; + + var paramList = new [] { emptyParam, intParam }; + var expected1 = paramList.Select (p => GetMemberFilter ("A", memberName, m => MatchParameters (m, p))).ToList (); + foreach (var filter in expected1) + TestCollectMembers (code, "A", memberName, expected1, filter, true, true); + + var expected2 = new List<Predicate<IMember>> { GetMemberFilter ("A", memberName, m => MatchParameters (m, emptyParam)) }; + TestCollectMembers (code, "A", memberName, expected2, expected2 [0], false, true); + + var expected3 = new List<Predicate<IMember>> { GetMemberFilter ("B", memberName, m => MatchParameters (m, emptyParam)) }; + TestCollectMembers (code, "B", memberName, expected3, expected3 [0], false, true); + } + [Test] public void TestConstructor () { diff --git a/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/SearchCollectorTests.cs b/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/SearchCollectorTests.cs index 8ab87831c8..1277e03676 100755 --- a/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/SearchCollectorTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/SearchCollectorTests.cs @@ -97,7 +97,7 @@ namespace project1 { { } }"; var project1 = new UnknownProject { FileName = "projectc1.csproj" }; - var project2 = new DotNetAssemblyProject { FileName = "projectc2.csproj" }; + var project2 = new MonoDevelop.CSharp.Project.CSharpProject { FileName = "projectc2.csproj" }; project2.References.Add (new MonoDevelop.Projects.ProjectReference (project1)); var solution = new Solution (); @@ -148,7 +148,7 @@ namespace project1 { } }"; var project1 = new UnknownProject { FileName = "project1.csproj" }; - var project2 = new DotNetAssemblyProject { FileName = "project2.csproj" }; + var project2 = new MonoDevelop.CSharp.Project.CSharpProject { FileName = "project2.csproj" }; var solution = new Solution (); solution.RootFolder.AddItem (project1); solution.RootFolder.AddItem (project2); @@ -183,7 +183,7 @@ namespace project1 { var projects = new List<Project> (); var solution = new Solution (); for (int i = 0; i < 3; i++) { - var project = new DotNetAssemblyProject { FileName = String.Format ("projectx{0}.csproj", i) }; + var project = new MonoDevelop.CSharp.Project.CSharpProject { FileName = String.Format ("projectx{0}.csproj", i) }; projects.Add (project); solution.RootFolder.AddItem (project); project.AddFile (new ProjectFile (String.Format ("dummy{0}.cs", i))); diff --git a/main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs index cb113fa442..982f80bc48 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs @@ -47,7 +47,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("vs-local-copy", "VSLocalCopyTest.sln"); - WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Assert.IsTrue (item is Solution); Solution sol = (Solution) item; @@ -188,7 +188,7 @@ namespace MonoDevelop.Projects static void AssertCleanBuild (Solution sol, string configuration) { - BuildResult cr = sol.Build (Util.GetMonitor (), configuration); + BuildResult cr = sol.Build (Util.GetMonitor (), configuration).Result; Assert.IsNotNull (cr); Assert.AreEqual (0, cr.ErrorCount); @@ -209,11 +209,15 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("local-copy-package", "ConsoleProject.sln"); - WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Solution sol = (Solution) item; var p = (DotNetProject)sol.Items [0]; var ar = p.References.First (r => r.Reference.Contains ("gtk")); + + if (!ar.Package.IsGacPackage) + Assert.Ignore ("This test only works with gtk-sharp as a GAC package."); + Assert.AreEqual (false, ar.LocalCopy); ar.LocalCopy = true; Assert.AreEqual (true, ar.LocalCopy); @@ -233,8 +237,8 @@ namespace MonoDevelop.Projects ar.LocalCopy = false; Assert.AreEqual (false, ar.LocalCopy); - sol.Save (new NullProgressMonitor ()); - sol.Build (new NullProgressMonitor (), "Debug"); + sol.Save (new ProgressMonitor ()); + sol.Build (new ProgressMonitor (), "Debug").Wait (); string exeDebug = Platform.IsWindows ? ".pdb" : ".exe.mdb"; diff --git a/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs index 8c834806e6..e44f9386a1 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs @@ -50,14 +50,14 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-project", "ConsoleProject.sln"); - WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution item = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Assert.IsTrue (item is Solution); Solution sol = (Solution) item; TestProjectsChecks.CheckBasicVsConsoleProject (sol); string projectFile = ((Project)sol.Items [0]).FileName; - BuildResult cr = item.Build (Util.GetMonitor (), "Debug"); + BuildResult cr = item.Build (Util.GetMonitor (), "Debug").Result; Assert.IsNotNull (cr); Assert.AreEqual (0, cr.ErrorCount); Assert.AreEqual (0, cr.WarningCount); @@ -78,12 +78,12 @@ namespace MonoDevelop.Projects sol.Save (Util.GetMonitor ()); // Ensure the project is buildable - var result = sol.Build (Util.GetMonitor (), "Debug"); + var result = sol.Build (Util.GetMonitor (), "Debug").Result; Assert.AreEqual (0, result.ErrorCount, "#1"); // Ensure the project is still buildable with xbuild after a rename - ProjectOptionsDialog.RenameItem (sol.GetAllProjects () [0], "Test"); - result = sol.Build (Util.GetMonitor (), "Release"); + ProjectOptionsDialog.RenameItem (sol.GetAllProjects ().First (), "Test"); + result = sol.Build (Util.GetMonitor (), "Release").Result; Assert.AreEqual (0, result.ErrorCount, "#2"); } @@ -97,7 +97,7 @@ namespace MonoDevelop.Projects // msbuild format string solXml = File.ReadAllText (sol.FileName); - string projectXml = Util.GetXmlFileInfoset (((SolutionEntityItem)sol.Items [0]).FileName); + string projectXml = Util.GetXmlFileInfoset (((SolutionItem)sol.Items [0]).FileName); // Make sure we compare using the same guid Project p = sol.Items [0] as Project; @@ -140,7 +140,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMerging () { string solFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging.sln"); - Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution; + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; Assert.IsNotNull (sol); Assert.AreEqual (1, sol.Items.Count); @@ -187,7 +187,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingConfigPlatformCombinations () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging2.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); Assert.IsNotNull (p.Configurations ["Debug|x86"]); @@ -209,7 +209,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingDefaultValues () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging3.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); DotNetProjectConfiguration conf = p.Configurations ["Release|x86"] as DotNetProjectConfiguration; @@ -229,7 +229,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingKeepOldConfig () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging4.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); DotNetProjectConfiguration conf = p.Configurations ["Debug|x86"] as DotNetProjectConfiguration; @@ -255,7 +255,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingChangeNoMergeToParent () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging5.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); DotNetProjectConfiguration conf = p.Configurations ["Debug|x86"] as DotNetProjectConfiguration; @@ -276,7 +276,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingChangeMergeToParent () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging6.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); DotNetProjectConfiguration conf = p.Configurations ["Debug|x86"] as DotNetProjectConfiguration; @@ -298,7 +298,7 @@ namespace MonoDevelop.Projects public void TestConfigurationMergingChangeMergeToParent2 () { string projectFile = Util.GetSampleProject ("test-configuration-merging", "TestConfigurationMerging7.csproj"); - DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile) as DotNetProject; + DotNetProject p = Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projectFile).Result as DotNetProject; Assert.IsNotNull (p); DotNetProjectConfiguration conf = p.Configurations ["Debug|x86"] as DotNetProjectConfiguration; @@ -320,7 +320,7 @@ namespace MonoDevelop.Projects public void ProjectReferenceWithSpace () { string solFile = Util.GetSampleProject ("project-ref-with-spaces", "project-ref-with-spaces.sln"); - Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution; + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; Assert.IsNotNull (sol); Assert.AreEqual (2, sol.Items.Count); @@ -344,7 +344,7 @@ namespace MonoDevelop.Projects conf.OutputAssembly = value; sol.Save (Util.GetMonitor ()); - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName).Result; p = (DotNetProject) sol.GetAllProjects ().First (); conf = ((DotNetProjectConfiguration)p.Configurations [0]); @@ -359,35 +359,48 @@ namespace MonoDevelop.Projects Environment.SetEnvironmentVariable ("SOME_PLACE", dir); string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln"); - Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution; + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; var p = (DotNetProject) sol.GetAllProjects ().First (); Assert.AreEqual ("Program1_test1.cs", p.Files[0].FilePath.FileName, "Basic replacement"); Assert.AreEqual ("Program2_test1_test2.cs", p.Files[1].FilePath.FileName, "Property referencing same property"); - Assert.AreEqual ("Program3_$(DebugType).cs", p.Files[2].FilePath.FileName, "Property inside group with non-evaluable condition"); + Assert.AreEqual ("Program3_full.cs", p.Files[2].FilePath.FileName, "Property inside group with non-evaluable condition"); Assert.AreEqual ("Program4_yes_value.cs", p.Files[3].FilePath.FileName, "Evaluation of group condition"); Assert.AreEqual ("Program5_yes_value.cs", p.Files[4].FilePath.FileName, "Evaluation of property condition"); - Assert.AreEqual ("Program6_$(FFF).cs", p.Files[5].FilePath.FileName, "Evaluation of property with non-evaluable condition"); + Assert.AreEqual ("Program6_unknown.cs", p.Files[5].FilePath.FileName, "Evaluation of property with non-evaluable condition"); Assert.AreEqual ("Program7_test1.cs", p.Files[6].FilePath.FileName, "Item conditions are ignored"); - Assert.AreEqual ("Program8_test1.cs", p.Files[7].FilePath.FileName, "Item group conditions are ignored"); - Assert.AreEqual ("Program9_$(GGG).cs", p.Files[8].FilePath.FileName, "Non-evaluable property group clears properties"); - Assert.AreEqual ("Program10_$(AAA", p.Files[9].FilePath.FileName, "Invalid property reference"); - Assert.AreEqual ("Program11_EnvTest.cs", p.Files[10].FilePath.FileName, "Environment variable"); var testRef = Path.Combine (dir, "MonoDevelop.Core.dll"); var asms = p.GetReferencedAssemblies (sol.Configurations [0].Selector).ToArray (); Assert.IsTrue (asms.Contains (testRef)); } + [Ignore ("xbuild bug. It is not returning correct values for evaluated items without condition list")] + [Test] + public void EvaluatePropertiesWithConditionalGroup () + { + string dir = Path.GetDirectoryName (typeof(Project).Assembly.Location); + Environment.SetEnvironmentVariable ("HHH", "EnvTest"); + Environment.SetEnvironmentVariable ("SOME_PLACE", dir); + + string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln"); + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; + var p = (DotNetProject) sol.GetAllProjects ().First (); + Assert.AreEqual ("Program8_test1.cs", p.Files[7].FilePath.FileName, "Item group conditions are not ignored"); + Assert.AreEqual ("Program9_$(GGG).cs", p.Files[8].FilePath.FileName, "Non-evaluable property group clears properties"); + Assert.AreEqual ("Program10_$(AAA", p.Files[9].FilePath.FileName, "Invalid property reference"); + Assert.AreEqual ("Program11_EnvTest.cs", p.Files[10].FilePath.FileName, "Environment variable"); + } + void LoadBuildVSConsoleProject (string vsVersion, string toolsVersion) { string solFile = Util.GetSampleProject ("ConsoleApp-VS" + vsVersion, "ConsoleApplication.sln"); - var monitor = new NullProgressMonitor (); - var sol = (Solution)Services.ProjectService.ReadWorkspaceItem (monitor, solFile); + var monitor = new ProgressMonitor (); + var sol = (Solution)Services.ProjectService.ReadWorkspaceItem (monitor, solFile).Result; Assert.IsTrue (monitor.Errors.Length == 0); Assert.IsTrue (monitor.Warnings.Length == 0); var p = (DotNetProject) sol.GetAllProjects ().First (); - Assert.AreEqual (toolsVersion, MSBuildProjectService.GetHandler (p).ToolsVersion); - var r = sol.Build (monitor, "Debug"); + Assert.AreEqual (toolsVersion, p.ToolsVersion); + var r = sol.Build (monitor, "Debug").Result; Assert.IsTrue (monitor.Errors.Length == 0); Assert.IsTrue (monitor.Warnings.Length == 0); Assert.IsFalse (r.Failed); @@ -436,12 +449,12 @@ namespace MonoDevelop.Projects public void SaveReferenceWithCondition () { string solFile = Util.GetSampleProject ("console-project-conditional-reference", "ConsoleProject.sln"); - Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution; + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; string proj = sol.GetAllProjects ().First ().FileName; string projectXml1 = Util.GetXmlFileInfoset (proj); - sol.Save (new NullProgressMonitor ()); + sol.Save (new ProgressMonitor ()); string projectXml2 = Util.GetXmlFileInfoset (proj); Assert.AreEqual (projectXml1, projectXml2); @@ -482,5 +495,20 @@ namespace MonoDevelop.Projects Assert.AreEqual (condition, import.GetAttribute ("Condition")); } + + [Test] + public void ProjectWithCustomConfigPropertyGroupBug20554 () + { + string solFile = Util.GetSampleProject ("console-project-custom-configs", "ConsoleProject.sln"); + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; + + string proj = sol.GetAllProjects ().First ().FileName; + + string projectXml1 = Util.GetXmlFileInfoset (proj); + sol.Save (new ProgressMonitor ()); + + string projectXml2 = Util.GetXmlFileInfoset (proj); + Assert.AreEqual (projectXml1, projectXml2); + } } } diff --git a/main/tests/UnitTests/MonoDevelop.Projects/MakefileTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/MakefileTests.cs index c66a684c1f..37f28ce6de 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/MakefileTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/MakefileTests.cs @@ -68,7 +68,7 @@ namespace MonoDevelop.Projects Assert.Ignore (); string solFile = Util.GetSampleProject ("console-project-with-makefile", "ConsoleProject.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject p = (DotNetProject) sol.Items [0]; diff --git a/main/tests/UnitTests/MonoDevelop.Projects/MdsTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/MdsTests.cs index a1b8225b33..ca8678672c 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/MdsTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/MdsTests.cs @@ -47,7 +47,7 @@ namespace MonoDevelop.Projects sol.FileName = Path.Combine (dir, "thesolution"); ws.Items.Add (sol); - DotNetAssemblyProject p = new DotNetAssemblyProject ("C#"); + DotNetProject p = Services.ProjectService.CreateDotNetProject ("C#"); p.FileName = Path.Combine (dir, "theproject"); sol.RootFolder.Items.Add (p); diff --git a/main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs index 7b1bc7d9d0..7da7a99a82 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs @@ -31,6 +31,7 @@ using NUnit.Framework; using UnitTests; using MonoDevelop.Core; using System.Linq; +using System.Xml; namespace MonoDevelop.Projects { @@ -40,7 +41,7 @@ namespace MonoDevelop.Projects [Test()] public void ProjectFilePaths () { - DotNetProject project = new DotNetAssemblyProject ("C#"); + DotNetProject project = Services.ProjectService.CreateDotNetProject ("C#"); string dir = Environment.CurrentDirectory; ProjectFile file1 = project.AddFile (Util.Combine (dir, "test1.cs"), BuildAction.Compile); @@ -67,10 +68,10 @@ namespace MonoDevelop.Projects public void Resources () { string solFile = Util.GetSampleProject ("resources-tester", "ResourcesTester.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; CheckResourcesSolution (sol); - BuildResult res = sol.Build (Util.GetMonitor (), "Debug"); + BuildResult res = sol.Build (Util.GetMonitor (), "Debug").Result; Assert.AreEqual (0, res.ErrorCount); Assert.AreEqual (0, res.WarningCount); Assert.AreEqual (1, res.BuildCount); @@ -78,7 +79,7 @@ namespace MonoDevelop.Projects string spath = Util.Combine (sol.BaseDirectory, "ResourcesTester", "bin", "Debug", "ca", "ResourcesTesterApp.resources.dll"); Assert.IsTrue (File.Exists (spath), "Satellite assembly not generated"); - sol.Clean (Util.GetMonitor (), "Debug"); + sol.Clean (Util.GetMonitor (), "Debug").Wait (); Assert.IsFalse (File.Exists (spath), "Satellite assembly not removed"); // msbuild doesn't delete this directory @@ -173,7 +174,10 @@ namespace MonoDevelop.Projects ProjectCreateInformation info = new ProjectCreateInformation (); info.ProjectName = "Some.Test"; info.ProjectBasePath = "/tmp/test"; - DotNetProject p = new DotNetAssemblyProject ("C#", info, null); + var doc = new XmlDocument (); + var projectOptions = doc.CreateElement ("Options"); + projectOptions.SetAttribute ("language", "C#"); + DotNetProject p = (DotNetProject) Services.ProjectService.CreateProject ("DotNet", info, projectOptions); Assert.AreEqual (2, p.Configurations.Count); Assert.AreEqual ("Debug", p.Configurations [0].Name); @@ -186,7 +190,7 @@ namespace MonoDevelop.Projects [Test()] public void NewConfigurationsHaveAnAssemblyName () { - DotNetProject p = new DotNetAssemblyProject ("C#"); + DotNetProject p = Services.ProjectService.CreateDotNetProject ("C#"); p.Name = "HiThere"; DotNetProjectConfiguration c = (DotNetProjectConfiguration) p.CreateConfiguration ("First"); Assert.AreEqual ("HiThere", c.OutputAssembly); @@ -195,7 +199,7 @@ namespace MonoDevelop.Projects [Test()] public void CustomCommands () { - DotNetProject p = new DotNetAssemblyProject ("C#"); + DotNetProject p = Services.ProjectService.CreateDotNetProject ("C#"); p.Name = "SomeProject"; DotNetProjectConfiguration c = (DotNetProjectConfiguration) p.CreateConfiguration ("First"); @@ -220,7 +224,7 @@ namespace MonoDevelop.Projects public void FileDependencies () { string solFile = Util.GetSampleProject ("file-dependencies", "ConsoleProject.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Project p = (Project) sol.Items [0]; var dir = p.BaseDirectory; @@ -288,8 +292,8 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("reference-refresh", "ConsoleProject.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - DotNetProject project = sol.GetAllSolutionItems<DotNetProject> ().FirstOrDefault (); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + DotNetProject project = sol.GetAllItems<DotNetProject> ().FirstOrDefault (); Assert.AreEqual (4, project.References.Count); @@ -435,7 +439,7 @@ namespace MonoDevelop.Projects [Test] public void AssemblyReferenceHintPath () { - var file = GetType ().Assembly.Location; + var file = (FilePath) GetType ().Assembly.Location; var asmName = Path.GetFileNameWithoutExtension (file); var r = new ProjectReference (ReferenceType.Assembly, file); @@ -447,5 +451,37 @@ namespace MonoDevelop.Projects Assert.AreEqual (file, r.HintPath); } + + [Test] + public void LoadPortableLibrary () + { + string solFile = Util.GetSampleProject ("portable-library", "portable-library.sln"); + + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + var p = sol.FindProjectByName ("PortableLibrary"); + + Assert.IsInstanceOf<DotNetProject> (p); + + var pl = (DotNetProject)p; + Assert.AreEqual (".NETPortable", pl.GetDefaultTargetFrameworkId ().Identifier); + } + + [Test] + public void BuildPortableLibrary () + { + string solFile = Util.GetSampleProject ("portable-library", "portable-library.sln"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + var res = sol.Build (Util.GetMonitor (), "Debug").Result; + Assert.AreEqual (0, res.Errors.Count); + } + + [Test] + public void PortableLibraryImplicitReferences () + { + string solFile = Util.GetSampleProject ("portable-library", "portable-library.sln"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + var p = (DotNetProject) sol.FindProjectByName ("PortableLibrary"); + var refs = p.GetReferencedAssemblies (p.Configurations [0].Selector).Select (r => Path.GetFileName (r)).ToArray (); + } } } diff --git a/main/tests/UnitTests/MonoDevelop.Projects/SharedAssetsProjectTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/SharedAssetsProjectTests.cs index dccaac4af8..4cc2f1b653 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/SharedAssetsProjectTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/SharedAssetsProjectTests.cs @@ -38,9 +38,7 @@ namespace MonoDevelop.Projects public void LoadSharedProject () { string solFile = Util.GetSampleProject ("SharedProjectTest", "SharedProjectTest.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - - Assert.AreEqual (4, sol.GetAllProjects ().Count); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; var pc1 = sol.FindProjectByName ("Console1"); Assert.IsNotNull (pc1); @@ -54,6 +52,8 @@ namespace MonoDevelop.Projects var pcs = (SharedAssetsProject) sol.FindProjectByName ("Shared"); Assert.IsNotNull (pcs); + Assert.AreEqual (4, sol.GetAllProjects ().Count ()); + var sharedFile = pcs.ItemDirectory.Combine ("MyClass.cs"); Assert.IsTrue (pc1.Files.GetFile (sharedFile) != null); @@ -68,7 +68,7 @@ namespace MonoDevelop.Projects public void PropagateFileChanges () { string solFile = Util.GetSampleProject ("SharedProjectTest", "SharedProjectTest.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; var pc1 = sol.FindProjectByName ("Console1"); var pc2 = sol.FindProjectByName ("Console2"); var pc3 = sol.FindProjectByName ("Console3"); @@ -113,7 +113,7 @@ namespace MonoDevelop.Projects public void AddReference () { string solFile = Util.GetSampleProject ("SharedProjectTest", "SharedProjectTest.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; var pcs = sol.FindProjectByName ("Shared"); var pc3 = (DotNetProject) sol.FindProjectByName ("Console3"); @@ -136,7 +136,7 @@ namespace MonoDevelop.Projects public void RemoveReference () { string solFile = Util.GetSampleProject ("SharedProjectTest", "SharedProjectTest.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; var pc1 = (DotNetProject) sol.FindProjectByName ("Console1"); var pc2 = (DotNetProject) sol.FindProjectByName ("Console2"); @@ -173,7 +173,7 @@ namespace MonoDevelop.Projects }; sp.AddFile (sol.ItemDirectory.Combine ("Test.cs")); - sp.Save (sol.ItemDirectory.Combine ("Shared"), Util.GetMonitor ()); + sp.Save (Util.GetMonitor (), sol.ItemDirectory.Combine ("Shared")); sol.RootFolder.AddItem (sp); sol.Save (Util.GetMonitor ()); @@ -282,7 +282,7 @@ namespace MonoDevelop.Projects Assert.IsNull (sol.StartupItem); // An executable project is set as startup by default when there is no startup project - DotNetAssemblyProject project = new DotNetAssemblyProject ("C#"); + var project = Services.ProjectService.CreateDotNetProject ("C#"); sol.RootFolder.AddItem (project); Assert.IsTrue (sol.StartupItem == project); } @@ -297,7 +297,7 @@ namespace MonoDevelop.Projects sol.RootFolder.AddItem (shared); // Reference to shared is added before adding project to solution - var main = new DotNetAssemblyProject ("C#"); + var main = Services.ProjectService.CreateDotNetProject ("C#"); main.References.Add (new ProjectReference (shared)); sol.RootFolder.AddItem (main); @@ -312,7 +312,7 @@ namespace MonoDevelop.Projects shared.AddFile ("Foo.cs"); // Reference to shared is added before adding project to solution - var main = new DotNetAssemblyProject ("C#"); + var main = Services.ProjectService.CreateDotNetProject ("C#"); main.References.Add (new ProjectReference (shared)); sol.RootFolder.AddItem (main); @@ -329,7 +329,7 @@ namespace MonoDevelop.Projects var shared = new SharedAssetsProject ("C#"); shared.AddFile ("Foo.cs"); - var main = new DotNetAssemblyProject ("C#"); + var main = Services.ProjectService.CreateDotNetProject ("C#"); var pref = new ProjectReference (shared); main.References.Add (pref); @@ -346,6 +346,49 @@ namespace MonoDevelop.Projects Assert.IsNull (main.Files.GetFile ("Foo.cs")); Assert.IsFalse (main.References.Contains (pref)); } + + [Test] + public void ProjItemsFileNameNotMatchingShproj_Bug20571 () + { + string solFile = Util.GetSampleProject ("SharedProjectTestBug20571", "SharedProjectTest.sln"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + + Assert.AreEqual (3, sol.GetAllProjects ().Count()); + + var pc1 = (DotNetProject) sol.FindProjectByName ("Console1"); + Assert.IsNotNull (pc1); + + var pc2 = (DotNetProject) sol.FindProjectByName ("Console2"); + Assert.IsNotNull (pc2); + + var pcs = (SharedAssetsProject) sol.FindProjectByName ("Shared"); + Assert.IsNotNull (pcs); + + Assert.IsTrue (pc1.References.Any (r => r.Reference == "Shared")); + + var sharedFile = pcs.ItemDirectory.Combine ("MyClass.cs"); + + Assert.IsTrue (pc1.Files.GetFile (sharedFile) != null); + Assert.IsTrue (pc2.Files.GetFile (sharedFile) == null); + Assert.IsTrue (pcs.Files.GetFile (sharedFile) != null); + + pc2.References.Add (new ProjectReference (pcs)); + Assert.IsTrue (pc2.Files.GetFile (sharedFile) != null); + + pc2.Save (Util.GetMonitor ()); + + Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName).Result; + sol.Dispose (); + + pc2 = (DotNetProject) sol2.FindProjectByName ("Console2"); + Assert.IsNotNull (pc2); + + Assert.IsTrue (pc2.References.Any (r => r.Reference == "Shared")); + + Assert.IsTrue (pc2.Files.GetFile (sharedFile) != null); + + sol2.Dispose (); + } } } diff --git a/main/tests/UnitTests/MonoDevelop.Projects/SolutionFolderTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/SolutionFolderTests.cs index ec5ad7841a..6080f5d6f3 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/SolutionFolderTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/SolutionFolderTests.cs @@ -39,7 +39,7 @@ namespace MonoDevelop.Projects public void CheckProjectContainsItself () { var folder = new SolutionFolder (); - var project = new DotNetAssemblyProject { Name = "foo" }; + var project = new MonoDevelop.CSharp.Project.CSharpProject { Name = "foo" }; folder.AddItem (project); Assert.IsNotNull (folder.GetProjectContainingFile (project.FileName), "#1"); diff --git a/main/tests/UnitTests/MonoDevelop.Projects/SolutionTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/SolutionTests.cs index 4535f14339..9073fa61d4 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/SolutionTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/SolutionTests.cs @@ -89,14 +89,14 @@ namespace MonoDevelop.Projects Assert.AreEqual (1, countSolutionItemAdded); Assert.AreEqual (0, sol.Items.Count); - DotNetAssemblyProject project = new DotNetAssemblyProject ("C#"); + var project = Services.ProjectService.CreateDotNetProject ("C#"); project.Name = "project1"; sol.RootFolder.Items.Add (project); Assert.AreEqual (2, countSolutionItemAdded); Assert.AreEqual (1, sol.Items.Count); - DotNetAssemblyProject project2 = new DotNetAssemblyProject ("C#"); + var project2 = Services.ProjectService.CreateDotNetProject ("C#"); project2.Name = "project2"; folder.Items.Add (project2); @@ -197,7 +197,7 @@ namespace MonoDevelop.Projects { int nameChanges = 0; - DotNetAssemblyProject prj = new DotNetAssemblyProject ("C#"); + var prj = Services.ProjectService.CreateDotNetProject ("C#"); prj.FileFormat = Util.FileFormatMSBuild05; prj.NameChanged += delegate { nameChanges++; @@ -279,7 +279,7 @@ namespace MonoDevelop.Projects Assert.IsFalse (p.NeedsReload); string solFile2 = Util.GetSampleProject ("csharp-console", "csharp-console.sln"); - Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile2); + Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile2).Result; Project p2 = sol2.Items [0] as Project; Assert.IsFalse (sol2.NeedsReload); Assert.IsFalse (p2.NeedsReload); @@ -287,7 +287,7 @@ namespace MonoDevelop.Projects // Check reloading flag in another solution string solFile = sol.FileName; - Solution sol3 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol3 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Assert.IsFalse (sol3.NeedsReload); Project p3 = sol3.Items [0] as Project; @@ -304,7 +304,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-with-libs", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject p = (DotNetProject) sol.FindProjectByName ("console-with-libs"); DotNetProject lib2 = (DotNetProject) sol.FindProjectByName ("library2"); @@ -320,7 +320,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-with-libs", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject p = (DotNetProject) sol.FindProjectByName ("console-with-libs"); DotNetProject lib2 = (DotNetProject) sol.FindProjectByName ("library2"); @@ -333,7 +333,7 @@ namespace MonoDevelop.Projects // Test that build configuration info is not lost when reloading a project - lib2 = (DotNetProject) lib2.ParentFolder.ReloadItem (Util.GetMonitor (), lib2); + lib2 = (DotNetProject) lib2.ParentFolder.ReloadItem (Util.GetMonitor (), lib2).Result; be = sol.Configurations ["Debug"].GetEntryForItem (lib2); Assert.IsFalse (be.Build); @@ -341,7 +341,7 @@ namespace MonoDevelop.Projects // Test that startup project is the reloaded project - p = (DotNetProject) p.ParentFolder.ReloadItem (Util.GetMonitor (), p); + p = (DotNetProject) p.ParentFolder.ReloadItem (Util.GetMonitor (), p).Result; Assert.AreSame (sol.StartupItem, p); } @@ -350,22 +350,22 @@ namespace MonoDevelop.Projects { Solution sol = TestProjectsChecks.CreateConsoleSolution ("item-files"); - List<FilePath> files = sol.GetItemFiles (false); + List<FilePath> files = sol.GetItemFiles (false).ToList (); Assert.AreEqual (1, files.Count); Assert.AreEqual (sol.FileName, files [0]); DotNetProject p = (DotNetProject) sol.Items [0]; - files = p.GetItemFiles (false); + files = p.GetItemFiles (false).ToList (); Assert.AreEqual (1, files.Count); Assert.AreEqual (p.FileName, files [0]); - files = p.GetItemFiles (true); + files = p.GetItemFiles (true).ToList (); Assert.AreEqual (6, files.Count); Assert.IsTrue (files.Contains (p.FileName)); foreach (ProjectFile pf in p.Files) Assert.IsTrue (files.Contains (pf.FilePath), "Contains " + pf.FilePath); - files = sol.GetItemFiles (true); + files = sol.GetItemFiles (true).ToList (); Assert.AreEqual (7, files.Count); Assert.IsTrue (files.Contains (sol.FileName)); Assert.IsTrue (files.Contains (p.FileName)); @@ -378,7 +378,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-with-libs", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject p = (DotNetProject) sol.FindProjectByName ("console-with-libs"); Assert.IsNotNull (p); DotNetProject lib1 = (DotNetProject) sol.FindProjectByName ("library1"); @@ -394,7 +394,7 @@ namespace MonoDevelop.Projects // Build the project and the references - BuildResult res = p.Build (Util.GetMonitor (), config, true); + BuildResult res = p.Build (Util.GetMonitor (), config, true).Result; foreach (BuildError er in res.Errors) Console.WriteLine (er); Assert.AreEqual (0, res.ErrorCount); @@ -410,7 +410,7 @@ namespace MonoDevelop.Projects // Build the project, but not the references - res = p.Build (Util.GetMonitor (), config, false); + res = p.Build (Util.GetMonitor (), config, false).Result; Assert.AreEqual (0, res.ErrorCount); Assert.AreEqual (0, res.WarningCount); Assert.AreEqual (1, res.BuildCount); @@ -421,7 +421,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-with-libs", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject p = (DotNetProject) sol.FindProjectByName ("console-with-libs"); DotNetProject lib1 = (DotNetProject) sol.FindProjectByName ("library1"); DotNetProject lib2 = (DotNetProject) sol.FindProjectByName ("library2"); @@ -439,7 +439,7 @@ namespace MonoDevelop.Projects // Build the project and the references - BuildResult res = ws.Build (Util.GetMonitor (), "Debug"); + BuildResult res = ws.Build (Util.GetMonitor (), ConfigurationSelector.Default).Result; Assert.AreEqual (0, res.ErrorCount); Assert.AreEqual (0, res.WarningCount); Assert.AreEqual (3, res.BuildCount); @@ -453,7 +453,7 @@ namespace MonoDevelop.Projects // Clean the workspace - ws.Clean (Util.GetMonitor (), "Debug"); + ws.Clean (Util.GetMonitor (), ConfigurationSelector.Default).Wait (); Assert.IsFalse (File.Exists (Util.Combine (p.BaseDirectory, "bin", "Debug", "console-with-libs.exe"))); Assert.IsFalse (File.Exists (Util.Combine (p.BaseDirectory, "bin", "Debug", GetMdb ("console-with-libs.exe")))); Assert.IsFalse (File.Exists (Util.Combine (lib1.BaseDirectory, "bin", "Debug", "library1.dll"))); @@ -463,7 +463,7 @@ namespace MonoDevelop.Projects // Build the solution - res = ws.Build (Util.GetMonitor (), "Debug"); + res = ws.Build (Util.GetMonitor (), ConfigurationSelector.Default).Result; Assert.AreEqual (0, res.ErrorCount); Assert.AreEqual (0, res.WarningCount); Assert.AreEqual (3, res.BuildCount); @@ -477,7 +477,7 @@ namespace MonoDevelop.Projects // Clean the solution - sol.Clean (Util.GetMonitor (), "Debug"); + sol.Clean (Util.GetMonitor (), "Debug").Wait (); Assert.IsFalse (File.Exists (Util.Combine (p.BaseDirectory, "bin", "Debug", "console-with-libs.exe"))); Assert.IsFalse (File.Exists (Util.Combine (p.BaseDirectory, "bin", "Debug", GetMdb ("console-with-libs.exe")))); Assert.IsFalse (File.Exists (Util.Combine (lib1.BaseDirectory, "bin", "Debug", "library1.dll"))); @@ -487,7 +487,7 @@ namespace MonoDevelop.Projects // Build the solution folder - res = folder.Build (Util.GetMonitor (), (SolutionConfigurationSelector) "Debug"); + res = folder.Build (Util.GetMonitor (), (SolutionConfigurationSelector) "Debug").Result; Assert.AreEqual (0, res.ErrorCount); Assert.AreEqual (0, res.WarningCount); Assert.AreEqual (1, res.BuildCount); @@ -501,7 +501,7 @@ namespace MonoDevelop.Projects // Clean the solution folder - folder.Clean (Util.GetMonitor (), (SolutionConfigurationSelector) "Debug"); + folder.Clean (Util.GetMonitor (), (SolutionConfigurationSelector) "Debug").Wait (); Assert.IsFalse (File.Exists (Util.Combine (lib2.BaseDirectory, "bin", "Debug", "library2.dll"))); Assert.IsFalse (File.Exists (Util.Combine (lib2.BaseDirectory, "bin", "Debug", GetMdb ("library2.dll")))); } @@ -514,7 +514,7 @@ namespace MonoDevelop.Projects Assert.AreEqual (Services.ProjectService.DefaultFileFormat.Id, sol.FileFormat.Id); Assert.AreEqual (Services.ProjectService.DefaultFileFormat.Id, p.FileFormat.Id); - Assert.AreEqual ("4.0", MSBuildProjectService.GetHandler (p).ToolsVersion); + Assert.AreEqual ("4.0", p.ToolsVersion); // Change solution format of unsaved solution @@ -522,38 +522,38 @@ namespace MonoDevelop.Projects Assert.AreEqual ("MSBuild08", sol.FileFormat.Id); Assert.AreEqual ("MSBuild08", p.FileFormat.Id); - Assert.AreEqual ("3.5", MSBuildProjectService.GetHandler (p).ToolsVersion); + Assert.AreEqual ("3.5", p.ToolsVersion); sol.ConvertToFormat (Util.FileFormatMSBuild10, true); Assert.AreEqual ("MSBuild10", sol.FileFormat.Id); Assert.AreEqual ("MSBuild10", p.FileFormat.Id); - Assert.AreEqual ("4.0", MSBuildProjectService.GetHandler (p).ToolsVersion); + Assert.AreEqual ("4.0", p.ToolsVersion); // Change solution format of saved solution sol.Save (Util.GetMonitor ()); sol.ConvertToFormat (Util.FileFormatMSBuild05, false); - + Assert.AreEqual ("MSBuild05", sol.FileFormat.Id); Assert.AreEqual ("MSBuild05", p.FileFormat.Id); - Assert.AreEqual ("2.0", MSBuildProjectService.GetHandler (p).ToolsVersion); + Assert.AreEqual ("2.0", p.ToolsVersion); // Add new project - Project newp = new DotNetAssemblyProject ("C#"); + Project newp = Services.ProjectService.CreateDotNetProject ("C#"); Assert.AreEqual ("MSBuild12", newp.FileFormat.Id); - Assert.AreEqual ("4.0", MSBuildProjectService.GetHandler (newp).ToolsVersion); + Assert.AreEqual ("4.0", newp.ToolsVersion); sol.RootFolder.Items.Add (newp); Assert.AreEqual ("MSBuild05", newp.FileFormat.Id); - Assert.AreEqual ("2.0", MSBuildProjectService.GetHandler (newp).ToolsVersion); + Assert.AreEqual ("2.0", newp.ToolsVersion); // Add saved project string solFile = Util.GetSampleProject ("console-project", "ConsoleProject.sln"); - Solution msol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution msol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; Project mp = (Project) msol.Items [0]; Assert.AreEqual ("MSBuild05", mp.FileFormat.Id); @@ -567,7 +567,7 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("test-build-configs", "test-build-configs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; DotNetProject lib1 = (DotNetProject) sol.FindProjectByName ("Lib1"); DotNetProject lib2 = (DotNetProject) sol.FindProjectByName ("Lib2"); DotNetProject lib3 = (DotNetProject) sol.FindProjectByName ("Lib3"); @@ -616,7 +616,7 @@ namespace MonoDevelop.Projects Assert.IsFalse (File.Exists (lib3.GetOutputFileName (config)), tag); Assert.IsFalse (File.Exists (lib4.GetOutputFileName (config)), tag); - BuildResult res = sol.Build (Util.GetMonitor (), config); + BuildResult res = sol.Build (Util.GetMonitor (), config).Result; Assert.AreEqual (0, res.WarningCount, tag); Assert.AreEqual (0, res.ErrorCount, tag); @@ -625,7 +625,7 @@ namespace MonoDevelop.Projects Assert.IsTrue (File.Exists (lib3.GetOutputFileName (config)), tag); Assert.IsTrue (File.Exists (lib4.GetOutputFileName (config)), tag); - sol.Clean (Util.GetMonitor (), config); + sol.Clean (Util.GetMonitor (), config).Wait (); Assert.IsFalse (File.Exists (lib1.GetOutputFileName (config)), tag); Assert.IsFalse (File.Exists (lib2.GetOutputFileName (config)), tag); @@ -647,7 +647,7 @@ namespace MonoDevelop.Projects Assert.IsFalse (File.Exists (lib3.GetOutputFileName (config)), tag); Assert.IsFalse (File.Exists (lib4.GetOutputFileName (config)), tag); - BuildResult res = lib1.Build (Util.GetMonitor (), config, true); + BuildResult res = lib1.Build (Util.GetMonitor (), config, true).Result; Assert.AreEqual (0, res.WarningCount, tag); Assert.AreEqual (0, res.ErrorCount, tag + " " + res.CompilerOutput); @@ -666,13 +666,13 @@ namespace MonoDevelop.Projects Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag); - BuildResult res = lib.Build (Util.GetMonitor (), config, false); + BuildResult res = lib.Build (Util.GetMonitor (), config, false).Result; Assert.AreEqual (0, res.WarningCount, tag); Assert.AreEqual (0, res.ErrorCount, tag); Assert.IsTrue (File.Exists (lib.GetOutputFileName (config)), tag); - lib.Clean (Util.GetMonitor (), config); + lib.Clean (Util.GetMonitor (), config).Wait (); Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag); } @@ -686,23 +686,27 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("unsupported-project", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - var app = sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.FileName.FileName == "console-with-libs.csproj"); - var lib1 = sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.FileName.FileName == "library1.csproj"); - var lib2 = sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.FileName.FileName == "library2.csproj"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + var app = sol.GetAllItems<SolutionItem> ().FirstOrDefault (it => it.FileName.FileName == "console-with-libs.csproj"); + var lib1 = sol.GetAllItems<SolutionItem> ().FirstOrDefault (it => it.FileName.FileName == "library1.csproj"); + var lib2 = sol.GetAllItems<SolutionItem> ().FirstOrDefault (it => it.FileName.FileName == "library2.csproj"); - Assert.IsInstanceOf<DotNetAssemblyProject> (app); - Assert.IsInstanceOf<UnknownSolutionItem> (lib1); - Assert.IsInstanceOf<UnknownProject> (lib2); + Assert.IsInstanceOf<DotNetProject> (app); + Assert.IsTrue (lib1.IsUnsupportedProject); + Assert.IsTrue (lib2.IsUnsupportedProject); - var p = (UnknownProject)lib2; + var p = (Project)lib2; Assert.AreEqual (2, p.Files.Count); p.AddFile (p.BaseDirectory.Combine ("Test.cs"), BuildAction.Compile); - sol.Save (new NullProgressMonitor ()); + + var solText = File.ReadAllLines (solFile); + + sol.Save (new ProgressMonitor ()); Assert.AreEqual (Util.GetXmlFileInfoset (p.FileName + ".saved"), Util.GetXmlFileInfoset (p.FileName)); + Assert.AreEqual (solText, File.ReadAllLines (solFile)); } [Test] @@ -710,26 +714,26 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("unsupported-project", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - var res = sol.Build (Util.GetMonitor (), "Debug"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + var res = sol.Build (Util.GetMonitor (), "Debug").Result; // The solution has a console app that references an unsupported library. The build of the solution should fail. - Assert.IsTrue (res.ErrorCount == 1); + Assert.AreEqual (1, res.ErrorCount); - var app = (DotNetAssemblyProject) sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.FileName.FileName == "console-with-libs.csproj"); + var app = sol.GetAllItems<DotNetProject> ().FirstOrDefault (it => it.FileName.FileName == "console-with-libs.csproj"); // The console app references an unsupported library. The build of the project should fail. - res = app.Build (Util.GetMonitor (), ConfigurationSelector.Default, true); + res = app.Build (Util.GetMonitor (), ConfigurationSelector.Default, true).Result; Assert.IsTrue (res.ErrorCount == 1); // A solution build should succeed if it has unbuildable projects but those projects are not referenced by buildable projects app.References.Clear (); sol.Save (Util.GetMonitor ()); - res = sol.Build (Util.GetMonitor (), "Debug"); + res = sol.Build (Util.GetMonitor (), "Debug").Result; Assert.IsTrue (res.ErrorCount == 0); // Regular project not referencing anything else. Should build. - res = app.Build (Util.GetMonitor (), ConfigurationSelector.Default, true); + res = app.Build (Util.GetMonitor (), ConfigurationSelector.Default, true).Result; Assert.IsTrue (res.ErrorCount == 0); } @@ -738,10 +742,10 @@ namespace MonoDevelop.Projects { string solFile = Util.GetSampleProject ("console-with-libs", "console-with-libs.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - SolutionEntityItem p = sol.FindProjectByName ("console-with-libs"); - SolutionEntityItem lib1 = sol.FindProjectByName ("library1"); - SolutionEntityItem lib2 = sol.FindProjectByName ("library2"); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + SolutionItem p = sol.FindProjectByName ("console-with-libs"); + SolutionItem lib1 = sol.FindProjectByName ("library1"); + SolutionItem lib2 = sol.FindProjectByName ("library2"); Assert.IsTrue (p.Enabled); Assert.IsTrue (lib1.Enabled); @@ -749,16 +753,16 @@ namespace MonoDevelop.Projects Assert.IsTrue (sol.Configurations [0].BuildEnabledForItem (p)); p.Enabled = false; - p.ParentFolder.ReloadItem (Util.GetMonitor (), p); + p.ParentFolder.ReloadItem (Util.GetMonitor (), p).Wait (); - p = sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.Name == "console-with-libs"); + p = sol.GetAllItems<SolutionItem> ().FirstOrDefault (it => it.Name == "console-with-libs"); Assert.IsNotNull (p); Assert.IsFalse (p.Enabled); Assert.IsTrue (lib1.Enabled); Assert.IsTrue (lib2.Enabled); p.Enabled = true; - p.ParentFolder.ReloadItem (Util.GetMonitor (), p); + p.ParentFolder.ReloadItem (Util.GetMonitor (), p).Wait (); p = sol.FindProjectByName ("console-with-libs"); Assert.IsNotNull (p); @@ -771,8 +775,8 @@ namespace MonoDevelop.Projects sol.Save (Util.GetMonitor ()); sol.Dispose (); - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); - lib1 = sol.GetAllSolutionItems<SolutionEntityItem> ().FirstOrDefault (it => it.Name == "library1"); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; + lib1 = sol.GetAllItems<SolutionItem> ().FirstOrDefault (it => it.Name == "library1"); Assert.IsNotNull (lib1); lib1.Enabled = true; lib1.ParentFolder.ReloadItem (Util.GetMonitor (), lib1); @@ -781,5 +785,147 @@ namespace MonoDevelop.Projects Assert.IsNotNull (lib1); Assert.IsTrue (sol.Configurations [0].BuildEnabledForItem (lib1)); } + + [Test] + public void SolutionBoundUnbound () + { + Solution sol = new Solution (); + + var e = new SomeItem (); + Assert.AreEqual (0, e.BoundEvents); + Assert.AreEqual (0, e.UnboundEvents); + + sol.RootFolder.AddItem (e); + Assert.AreEqual (1, e.BoundEvents); + Assert.AreEqual (0, e.UnboundEvents); + Assert.AreEqual (1, e.InternalItem.BoundEvents); + Assert.AreEqual (0, e.InternalItem.UnboundEvents); + + e.Reset (); + sol.RootFolder.Items.Remove (e); + Assert.AreEqual (0, e.BoundEvents); + Assert.AreEqual (1, e.UnboundEvents); + Assert.AreEqual (0, e.InternalItem.BoundEvents); + Assert.AreEqual (1, e.InternalItem.UnboundEvents); + + e.Reset (); + sol.RootFolder.AddItem (e); + Assert.AreEqual (1, e.BoundEvents); + Assert.AreEqual (0, e.UnboundEvents); + Assert.AreEqual (1, e.InternalItem.BoundEvents); + Assert.AreEqual (0, e.InternalItem.UnboundEvents); + + e.Reset (); + sol.RootFolder.Items.Remove (e); + Assert.AreEqual (0, e.BoundEvents); + Assert.AreEqual (1, e.UnboundEvents); + Assert.AreEqual (0, e.InternalItem.BoundEvents); + Assert.AreEqual (1, e.InternalItem.UnboundEvents); + + e.Reset (); + var f = new SolutionFolder (); + f.AddItem (e); + Assert.AreEqual (0, e.BoundEvents); + Assert.AreEqual (0, e.UnboundEvents); + Assert.AreEqual (0, e.InternalItem.BoundEvents); + Assert.AreEqual (0, e.InternalItem.UnboundEvents); + + sol.RootFolder.AddItem (f); + Assert.AreEqual (1, e.BoundEvents); + Assert.AreEqual (0, e.UnboundEvents); + Assert.AreEqual (1, e.InternalItem.BoundEvents); + Assert.AreEqual (0, e.InternalItem.UnboundEvents); + + e.Reset (); + sol.RootFolder.Items.Remove (f); + Assert.AreEqual (0, e.BoundEvents); + Assert.AreEqual (1, e.UnboundEvents); + Assert.AreEqual (0, e.InternalItem.BoundEvents); + Assert.AreEqual (1, e.InternalItem.UnboundEvents); + + f.Dispose (); + sol.Dispose (); + } + + [Test] + public void SolutionBuildOrder () + { + string solFile = Util.GetSampleProject ("solution-build-order", "ConsoleApplication3.sln"); + + Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result as Solution; + var p = sol.FindProjectByName ("ConsoleApplication3"); + var lib1 = sol.FindProjectByName ("ClassLibrary1"); + var lib2 = sol.FindProjectByName ("ClassLibrary2"); + + Assert.IsTrue (p.ItemDependencies.Contains (lib1)); + Assert.IsTrue (p.ItemDependencies.Contains (lib2)); + Assert.AreEqual (2, p.ItemDependencies.Count); + + Assert.IsTrue (lib2.ItemDependencies.Contains (lib1)); + Assert.AreEqual (1, lib2.ItemDependencies.Count); + Assert.AreEqual (0, lib1.ItemDependencies.Count); + + // Check that dependencies are saved + + var solContent1 = File.ReadAllLines (solFile); + + sol.Save (new ProgressMonitor ()); + + var solContent2 = File.ReadAllLines (solFile); + Assert.AreEqual (solContent1, solContent2); + + // Check that when an item is removed, it is removed from the dependencies list + + lib1.ParentFolder.Items.Remove (lib1); + lib1.Dispose (); + + Assert.IsTrue (p.ItemDependencies.Contains (lib2)); + Assert.AreEqual (1, p.ItemDependencies.Count); + Assert.AreEqual (0, lib2.ItemDependencies.Count); + + // Check that when an item is reloaded, it is kept from the dependencies list + + var lib2Reloaded = lib2.ParentFolder.ReloadItem (Util.GetMonitor (), lib2).Result; + + Assert.AreNotEqual (lib2, lib2Reloaded); + Assert.IsTrue (p.ItemDependencies.Contains (lib2Reloaded)); + Assert.AreEqual (1, p.ItemDependencies.Count); + } + } + + class SomeItem: SolutionItem + { + public int BoundEvents; + public int UnboundEvents; + + public SomeItem InternalItem; + + public SomeItem (bool createInternal = true) + { + Initialize (this); + if (createInternal) { + InternalItem = new SomeItem (false); + RegisterInternalChild (InternalItem); + } + } + + public void Reset () + { + BoundEvents = UnboundEvents = 0; + if (InternalItem != null) + InternalItem.Reset (); + } + + protected override void OnBoundToSolution () + { + base.OnBoundToSolution (); + BoundEvents++; + } + + protected override void OnUnboundFromSolution () + { + base.OnUnboundFromSolution (); + UnboundEvents++; + } } } diff --git a/main/tests/UnitTests/MonoDevelop.Projects/TestProjectsChecks.cs b/main/tests/UnitTests/MonoDevelop.Projects/TestProjectsChecks.cs index f19a1bf769..8bb9fe854a 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/TestProjectsChecks.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/TestProjectsChecks.cs @@ -33,6 +33,7 @@ using UnitTests; using MonoDevelop.Core.Serialization; using MonoDevelop.Core; using MonoDevelop.CSharp.Project; +using MonoDevelop.Projects.Formats.MSBuild; namespace MonoDevelop.Projects { @@ -146,7 +147,7 @@ namespace MonoDevelop.Projects Solution sol = new Solution (); SolutionConfiguration scDebug = sol.AddConfiguration ("Debug", true); - DotNetAssemblyProject project = new DotNetAssemblyProject ("C#"); + DotNetProject project = new CSharpProject (); sol.RootFolder.Items.Add (project); Assert.AreEqual (0, project.Configurations.Count); @@ -214,7 +215,7 @@ namespace Foo { public static DotNetProject CreateProject (string dir, string lang, string name) { - DotNetAssemblyProject project = new DotNetAssemblyProject (lang); + DotNetProject project = Services.ProjectService.CreateDotNetProject (lang); InitializeProject (dir, project, name); return project; } @@ -251,6 +252,8 @@ namespace Foo { string dir = Util.CreateTmpDir ("generic-item-" + fileFormat); sol.FileName = Path.Combine (dir, "TestGenericItem"); sol.Name = "TheItem"; + + MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.RegisterGenericProjectType ("GenericItem", typeof(GenericItem)); GenericItem it = new GenericItem (); it.SomeValue = "hi"; @@ -261,9 +264,9 @@ namespace Foo { sol.Save (Util.GetMonitor ()); - Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName); + Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName).Result; Assert.AreEqual (1, sol2.Items.Count); - Assert.IsTrue (sol2.Items [0] is GenericItem); + Assert.IsInstanceOf<GenericItem> (sol2.Items [0]); it = (GenericItem) sol2.Items [0]; Assert.AreEqual ("hi", it.SomeValue); @@ -279,7 +282,7 @@ namespace Foo { sol.FileName = Path.Combine (dir, "TestSolutionFolders"); sol.Name = "TheSolution"; - DotNetAssemblyProject p1 = new DotNetAssemblyProject ("C#"); + var p1 = Services.ProjectService.CreateDotNetProject ("C#"); p1.FileName = Path.Combine (dir, "p1"); sol.RootFolder.Items.Add (p1); string idp1 = p1.ItemId; @@ -295,7 +298,7 @@ namespace Foo { Assert.IsFalse (ids.Contains (idf1)); ids.Add (idf1); - DotNetAssemblyProject p2 = new DotNetAssemblyProject ("C#"); + var p2 = Services.ProjectService.CreateDotNetProject ("C#"); p2.FileName = Path.Combine (dir, "p2"); f1.Items.Add (p2); string idp2 = p2.ItemId; @@ -311,7 +314,7 @@ namespace Foo { Assert.IsFalse (ids.Contains (idf2)); ids.Add (idf2); - DotNetAssemblyProject p3 = new DotNetAssemblyProject ("C#"); + var p3 = Services.ProjectService.CreateDotNetProject ("C#"); p3.FileName = Path.Combine (dir, "p3"); f2.Items.Add (p3); string idp3 = p3.ItemId; @@ -319,7 +322,7 @@ namespace Foo { Assert.IsFalse (ids.Contains (idp3)); ids.Add (idp3); - DotNetAssemblyProject p4 = new DotNetAssemblyProject ("C#"); + var p4 = Services.ProjectService.CreateDotNetProject ("C#"); p4.FileName = Path.Combine (dir, "p4"); f2.Items.Add (p4); string idp4 = p4.ItemId; @@ -329,10 +332,10 @@ namespace Foo { sol.Save (Util.GetMonitor ()); - Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName); + Solution sol2 = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), sol.FileName).Result; Assert.AreEqual (4, sol2.Items.Count); Assert.AreEqual (2, sol2.RootFolder.Items.Count); - Assert.AreEqual (typeof(DotNetAssemblyProject), sol2.RootFolder.Items [0].GetType ()); + Assert.AreEqual (typeof(CSharpProject), sol2.RootFolder.Items [0].GetType ()); Assert.AreEqual (typeof(SolutionFolder), sol2.RootFolder.Items [1].GetType ()); Assert.AreEqual ("p1", sol2.RootFolder.Items [0].Name); Assert.AreEqual ("f1", sol2.RootFolder.Items [1].Name); @@ -341,7 +344,7 @@ namespace Foo { f1 = (SolutionFolder) sol2.RootFolder.Items [1]; Assert.AreEqual (2, f1.Items.Count); - Assert.AreEqual (typeof(DotNetAssemblyProject), f1.Items [0].GetType ()); + Assert.AreEqual (typeof(CSharpProject), f1.Items [0].GetType ()); Assert.AreEqual (typeof(SolutionFolder), f1.Items [1].GetType ()); Assert.AreEqual ("p2", f1.Items [0].Name); Assert.AreEqual ("f2", f1.Items [1].Name); @@ -350,8 +353,8 @@ namespace Foo { f2 = (SolutionFolder) f1.Items [1]; Assert.AreEqual (2, f2.Items.Count); - Assert.AreEqual (typeof(DotNetAssemblyProject), f2.Items [0].GetType ()); - Assert.AreEqual (typeof(DotNetAssemblyProject), f2.Items [1].GetType ()); + Assert.AreEqual (typeof(CSharpProject), f2.Items [0].GetType ()); + Assert.AreEqual (typeof(CSharpProject), f2.Items [1].GetType ()); Assert.AreEqual ("p3", f2.Items [0].Name); Assert.AreEqual ("p4", f2.Items [1].Name); Assert.AreEqual (idp3, f2.Items [0].ItemId, "idp4"); @@ -366,26 +369,26 @@ namespace Foo { sol.Save (Util.GetMonitor ()); string solFile = sol.FileName; - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; CheckConsoleProject (sol); // Save over existing file sol.Save (Util.GetMonitor ()); - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; CheckConsoleProject (sol); } public static void TestLoadSaveResources (string fileFormat) { string solFile = Util.GetSampleProject ("resources-tester", "ResourcesTester.sln"); - Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + Solution sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; sol.ConvertToFormat (Services.ProjectService.FileFormats.GetFileFormat (fileFormat), true); ProjectTests.CheckResourcesSolution (sol); sol.Save (Util.GetMonitor ()); solFile = sol.FileName; - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; ProjectTests.CheckResourcesSolution (sol); DotNetProject p = (DotNetProject) sol.Items [0]; @@ -394,7 +397,7 @@ namespace Foo { pf.ResourceId = "SomeBitmap.bmp"; sol.Save (Util.GetMonitor ()); - sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile); + sol = (Solution) Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile).Result; p = (DotNetProject) sol.Items [0]; f = Path.Combine (p.BaseDirectory, "Bitmap1.bmp"); pf = p.Files.GetFile (f); @@ -402,37 +405,26 @@ namespace Foo { } } - public class GenericItem: SolutionEntityItem + public class GenericItem: Project { [ItemProperty] public string SomeValue; - - protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration) - { - } - - protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration) - { - return null; - } - - protected override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration) - { - return null; - } - - protected override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration) + + public GenericItem () { + Initialize (this); } - - protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration) + + protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject) { - return false; + base.OnWriteProject (monitor, msproject); + msproject.GetGlobalPropertyGroup ().WriteObjectProperties (this, typeof(GenericItem)); } - - protected override void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration) + + protected override void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject) { + base.OnReadProject (monitor, msproject); + msproject.GetGlobalPropertyGroup ().ReadObjectProperties (this, typeof(GenericItem)); } - } } diff --git a/main/tests/UnitTests/MonoDevelop.Projects/WebProjectTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/WebProjectTests.cs index d0fb009f93..c2b5141e3f 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/WebProjectTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/WebProjectTests.cs @@ -43,13 +43,10 @@ namespace MonoDevelop.Projects public void LoadedWebProjectContainsWebProjectTypeGuid ()
{
string solutionFileName = Util.GetSampleProject ("WebProjectTest", "WebProjectTest.sln");
- var solution = (Solution)Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solutionFileName);
+ var solution = (Solution)Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solutionFileName).Result;
Project project = solution.GetAllProjects ().First ();
- string projectTypeGuids = (string) project.ExtendedProperties ["ProjectTypeGuids"];
- string[] guids = projectTypeGuids.Split (';');
-
- Assert.That (guids, Contains.Item ("{349C5851-65DF-11DA-9384-00065B846F21}"));
+ Assert.That (project.FlavorGuids, Contains.Item ("{349C5851-65DF-11DA-9384-00065B846F21}"));
}
}
}
diff --git a/main/tests/UnitTests/MonoDevelop.Projects/WorkspaceTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/WorkspaceTests.cs index 7e1d398b32..a3dc1cfcf0 100644 --- a/main/tests/UnitTests/MonoDevelop.Projects/WorkspaceTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Projects/WorkspaceTests.cs @@ -31,6 +31,7 @@ using System.Collections.ObjectModel; using NUnit.Framework; using UnitTests; using MonoDevelop.Core; +using System.Linq; namespace MonoDevelop.Projects { @@ -204,14 +205,14 @@ namespace MonoDevelop.Projects Solution sol1 = new Solution (); cws.Items.Add (sol1); sol1.RootFolder.Items.Add (it1 = new DummySolutionItem ()); - sol1.RootFolder.Items.Add (it2 = new DotNetAssemblyProject ("C#")); + sol1.RootFolder.Items.Add (it2 = Services.ProjectService.CreateDotNetProject ("C#")); Solution sol2 = new Solution (); cws.Items.Add (sol2); SolutionFolder f = new SolutionFolder (); sol2.RootFolder.Items.Add (f); - f.Items.Add (it3 = new DotNetAssemblyProject ("C#")); - f.Items.Add (it4 = new DotNetAssemblyProject ("C#")); + f.Items.Add (it3 = Services.ProjectService.CreateDotNetProject ("C#")); + f.Items.Add (it4 = Services.ProjectService.CreateDotNetProject ("C#")); it3.Name = "it3"; it4.FileName = "/test/it4"; @@ -227,7 +228,7 @@ namespace MonoDevelop.Projects Assert.IsTrue (sol2.Items.Contains (it3)); Assert.IsTrue (sol2.Items.Contains (it4)); - ReadOnlyCollection<SolutionItem> its = ws.GetAllSolutionItems (); + var its = ws.GetAllItems<SolutionFolderItem> ().ToList(); Assert.AreEqual (7, its.Count); Assert.IsTrue (its.Contains (it1)); Assert.IsTrue (its.Contains (it2)); @@ -237,45 +238,39 @@ namespace MonoDevelop.Projects Assert.IsTrue (its.Contains (sol2.RootFolder)); Assert.IsTrue (its.Contains (f)); - ReadOnlyCollection<DotNetProject> its2 = ws.GetAllSolutionItems<DotNetProject> (); + var its2 = ws.GetAllItems<DotNetProject> ().ToList(); Assert.AreEqual (3, its2.Count); Assert.IsTrue (its2.Contains (it2)); Assert.IsTrue (its2.Contains (it3)); Assert.IsTrue (its2.Contains (it4)); - ReadOnlyCollection<Project> its3 = ws.GetAllProjects (); + var its3 = ws.GetAllItems<Project> ().ToList(); Assert.AreEqual (3, its3.Count); Assert.IsTrue (its3.Contains (it2)); Assert.IsTrue (its3.Contains (it3)); Assert.IsTrue (its3.Contains (it4)); - ReadOnlyCollection<Solution> its4 = ws.GetAllSolutions (); + var its4 = ws.GetAllItems<Solution> ().ToList(); Assert.AreEqual (2, its4.Count); Assert.IsTrue (its4.Contains (sol1)); Assert.IsTrue (its4.Contains (sol2)); - ReadOnlyCollection<WorkspaceItem> its5= ws.GetAllItems (); + var its5 = ws.GetAllItems<WorkspaceItem> ().ToList(); Assert.AreEqual (4, its5.Count); Assert.IsTrue (its5.Contains (ws)); Assert.IsTrue (its5.Contains (cws)); Assert.IsTrue (its5.Contains (sol2)); Assert.IsTrue (its5.Contains (sol2)); - ReadOnlyCollection<Workspace> its6 = ws.GetAllItems<Workspace> (); + var its6 = ws.GetAllItems<Workspace> ().ToList(); Assert.AreEqual (2, its6.Count); Assert.IsTrue (its6.Contains (ws)); Assert.IsTrue (its6.Contains (cws)); - SolutionEntityItem fi = ws.FindSolutionItem (someFile); - Assert.AreEqual (it4, fi); - - fi = ws.FindSolutionItem (someFile + ".wrong"); - Assert.IsNull (fi); - - SolutionItem si = sol2.GetSolutionItem (someId); + SolutionFolderItem si = sol2.GetSolutionItem (someId); Assert.AreEqual (it3, si); - fi = sol2.FindSolutionItem (someFile); + SolutionItem fi = sol2.FindSolutionItem (someFile); Assert.AreEqual (it4, fi); fi = sol2.FindProjectByName ("it3"); @@ -305,14 +300,14 @@ namespace MonoDevelop.Projects Solution sol1 = new Solution (); cws.Items.Add (sol1); sol1.RootFolder.Items.Add (it1 = new DummySolutionItem ()); - sol1.RootFolder.Items.Add (it2 = new DotNetAssemblyProject ("C#")); + sol1.RootFolder.Items.Add (it2 = Services.ProjectService.CreateDotNetProject ("C#")); Solution sol2 = new Solution (); cws.Items.Add (sol2); SolutionFolder f = new SolutionFolder (); sol2.RootFolder.Items.Add (f); - f.Items.Add (it3 = new DotNetAssemblyProject ("C#")); - f.Items.Add (it4 = new DotNetAssemblyProject ("C#")); + f.Items.Add (it3 = Services.ProjectService.CreateDotNetProject ("C#")); + f.Items.Add (it4 = Services.ProjectService.CreateDotNetProject ("C#")); ws.ExtendedProperties ["data"] = d[0]; cws.ExtendedProperties ["data"] = d[1]; @@ -340,33 +335,11 @@ namespace MonoDevelop.Projects } - class DummySolutionItem: SolutionEntityItem + class DummySolutionItem: SolutionItem { - protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration) - { - } - - protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration) - { - return null; - } - - protected override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration) - { - return null; - } - - protected override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration) - { - } - - protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration) - { - return false; - } - - protected override void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration) + public DummySolutionItem () { + Initialize (this); } } } diff --git a/main/tests/UnitTests/MonoDevelop.Refactoring/FileGroupingProviderTests.cs b/main/tests/UnitTests/MonoDevelop.Refactoring/FileGroupingProviderTests.cs index 5f086c994a..4c67f88f88 100644 --- a/main/tests/UnitTests/MonoDevelop.Refactoring/FileGroupingProviderTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Refactoring/FileGroupingProviderTests.cs @@ -26,6 +26,7 @@ using MonoDevelop.CodeIssues;
using MonoDevelop.Projects;
using System.IO;
+using MonoDevelop.CSharp.Project;
namespace MonoDevelop.Refactoring
{
@@ -43,13 +44,13 @@ namespace MonoDevelop.Refactoring return new [] {
new IssueSummary {
File = new ProjectFile (Path.Combine ("Directory1", "File1")),
- Project = new DotNetAssemblyProject {
+ Project = new CSharpProject {
BaseDirectory = "Directory1"
}
},
new IssueSummary {
File = new ProjectFile (Path.Combine ("Directory2", "File2")),
- Project = new DotNetAssemblyProject {
+ Project = new CSharpProject {
BaseDirectory = "Directory1"
}
}
diff --git a/main/tests/UnitTests/MonoDevelop.Refactoring/GroupingProviderTestBase.cs b/main/tests/UnitTests/MonoDevelop.Refactoring/GroupingProviderTestBase.cs index 5b3995e18f..f38dcbbf66 100644 --- a/main/tests/UnitTests/MonoDevelop.Refactoring/GroupingProviderTestBase.cs +++ b/main/tests/UnitTests/MonoDevelop.Refactoring/GroupingProviderTestBase.cs @@ -29,6 +29,7 @@ using ICSharpCode.NRefactory.Refactoring; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory; using MonoDevelop.Projects; +using MonoDevelop.CSharp.Project; namespace MonoDevelop.Refactoring { @@ -67,7 +68,7 @@ namespace MonoDevelop.Refactoring ProviderTitle = "ProviderTitle", Region = new DomRegion("fileName", new TextLocation(2, 3), new TextLocation(2, 10)), Severity = Severity.None, - Project = new DotNetAssemblyProject { + Project = new CSharpProject { Name = "ProjectName" }, File = new ProjectFile ("FileName") diff --git a/main/tests/UnitTests/MonoDevelop.Refactoring/ProjectGroupingProviderTests.cs b/main/tests/UnitTests/MonoDevelop.Refactoring/ProjectGroupingProviderTests.cs index 8c3e512929..314aa103be 100644 --- a/main/tests/UnitTests/MonoDevelop.Refactoring/ProjectGroupingProviderTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Refactoring/ProjectGroupingProviderTests.cs @@ -25,6 +25,7 @@ // THE SOFTWARE.
using MonoDevelop.CodeIssues;
using MonoDevelop.Projects;
+using MonoDevelop.CSharp.Project;
namespace MonoDevelop.Refactoring
{
@@ -41,10 +42,10 @@ namespace MonoDevelop.Refactoring {
return new [] {
new IssueSummary {
- Project = new DotNetAssemblyProject { Name = "Project1" }
+ Project = new CSharpProject () { Name = "Project1" }
},
new IssueSummary {
- Project = new DotNetAssemblyProject { Name = "Project2" }
+ Project = new CSharpProject () { Name = "Project2" }
}
};
}
diff --git a/main/tests/UnitTests/Util.cs b/main/tests/UnitTests/Util.cs index f2b6c2b14a..e319824b37 100644 --- a/main/tests/UnitTests/Util.cs +++ b/main/tests/UnitTests/Util.cs @@ -72,12 +72,12 @@ namespace UnitTests get { return Services.ProjectService.FileFormats.GetFileFormat ("MSBuild12"); } } - public static IProgressMonitor GetMonitor () + public static ProgressMonitor GetMonitor () { return GetMonitor (true); } - public static IProgressMonitor GetMonitor (bool ignoreLogMessages) + public static ProgressMonitor GetMonitor (bool ignoreLogMessages) { ConsoleProgressMonitor m = new ConsoleProgressMonitor (); m.IgnoreLogMessages = ignoreLogMessages; diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console1/Console1.csproj b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Console1.csproj new file mode 100644 index 0000000000..77eca5289a --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Console1.csproj @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProjectGuid>{7A5198EC-20E7-4B49-9931-FBBCB58BDC27}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Console1</RootNamespace> + <AssemblyName>Console1</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="..\Shared\Other.projitems" Label="Shared" Condition="Exists('..\Shared\Other.projitems')" /> +</Project> diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console1/Program.cs b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Program.cs new file mode 100644 index 0000000000..65fa2729e0 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace Console1 +{ + class MainClass + { + public static void Main (string[] args) + { + Console.WriteLine ("Hello World!"); + } + } +} diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console1/Properties/AssemblyInfo.cs b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..68f9ea3576 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console1/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle ("Console1")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("Xamarin")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("Xamarin, Inc (http://www.xamarin.com)")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion ("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console2/Console2.csproj b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Console2.csproj new file mode 100644 index 0000000000..9dc5dc59c2 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Console2.csproj @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProjectGuid>{8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Console2</RootNamespace> + <AssemblyName>Console2</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console2/Program.cs b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Program.cs new file mode 100644 index 0000000000..cfad30cb17 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace Console2 +{ + class MainClass + { + public static void Main (string[] args) + { + Console.WriteLine ("Hello World!"); + } + } +} diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Console2/Properties/AssemblyInfo.cs b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..7c766a3aa0 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Console2/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle ("Console2")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("Xamarin")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("Xamarin, Inc (http://www.xamarin.com)")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion ("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Shared/MyClass.cs b/main/tests/test-projects/SharedProjectTestBug20571/Shared/MyClass.cs new file mode 100644 index 0000000000..796842c795 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Shared/MyClass.cs @@ -0,0 +1,12 @@ +using System; + +namespace Shared +{ + public class MyClass + { + public MyClass () + { + } + } +} + diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Shared/Other.projitems b/main/tests/test-projects/SharedProjectTestBug20571/Shared/Other.projitems new file mode 100644 index 0000000000..7bce768b0b --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Shared/Other.projitems @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <SharedGUID>{551C9391-1E8F-47D3-9C80-6AE04DE1AEE3}</SharedGUID> + </PropertyGroup> + <PropertyGroup Label="Configuration"> + <Import_RootNamespace>SharedNamespace</Import_RootNamespace> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildThisFileDirectory)MyClass.cs" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/SharedProjectTestBug20571/Shared/Shared.shproj b/main/tests/test-projects/SharedProjectTestBug20571/Shared/Shared.shproj new file mode 100644 index 0000000000..d19957f762 --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/Shared/Shared.shproj @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectGuid>{551C9391-1E8F-47D3-9C80-6AE04DE1AEE3}</ProjectGuid> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> + <Import Project="Other.projitems" Label="Shared" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> +</Project> diff --git a/main/tests/test-projects/SharedProjectTestBug20571/SharedProjectTest.sln b/main/tests/test-projects/SharedProjectTestBug20571/SharedProjectTest.sln new file mode 100644 index 0000000000..fa663a8d9c --- /dev/null +++ b/main/tests/test-projects/SharedProjectTestBug20571/SharedProjectTest.sln @@ -0,0 +1,28 @@ +
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console1", "Console1\Console1.csproj", "{7A5198EC-20E7-4B49-9931-FBBCB58BDC27}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console2", "Console2\Console2.csproj", "{8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Shared", "Shared\Shared.shproj", "{551C9391-1E8F-47D3-9C80-6AE04DE1AEE3}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7A5198EC-20E7-4B49-9931-FBBCB58BDC27}.Debug|x86.ActiveCfg = Debug|x86
+ {7A5198EC-20E7-4B49-9931-FBBCB58BDC27}.Debug|x86.Build.0 = Debug|x86
+ {7A5198EC-20E7-4B49-9931-FBBCB58BDC27}.Release|x86.ActiveCfg = Release|x86
+ {7A5198EC-20E7-4B49-9931-FBBCB58BDC27}.Release|x86.Build.0 = Release|x86
+ {8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}.Debug|x86.ActiveCfg = Debug|x86
+ {8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}.Debug|x86.Build.0 = Debug|x86
+ {8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}.Release|x86.ActiveCfg = Release|x86
+ {8F69FBA9-AA1B-4566-93F6-E86CF6C6D219}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = Console1\Console1.csproj
+ EndGlobalSection
+EndGlobal
diff --git a/main/tests/test-projects/console-project-custom-configs/ConsoleProject.sln b/main/tests/test-projects/console-project-custom-configs/ConsoleProject.sln new file mode 100755 index 0000000000..199aa24543 --- /dev/null +++ b/main/tests/test-projects/console-project-custom-configs/ConsoleProject.sln @@ -0,0 +1,23 @@ +
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleProject", "ConsoleProject\ConsoleProject.csproj", "{4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = ConsoleProject\ConsoleProject.csproj
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/main/tests/test-projects/console-project-custom-configs/ConsoleProject/ConsoleProject.csproj b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/ConsoleProject.csproj new file mode 100755 index 0000000000..557d03c009 --- /dev/null +++ b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/ConsoleProject.csproj @@ -0,0 +1,53 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4A9E3523-48F0-4BDF-A0F4-49DAD4431FAB}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ConsoleProject</RootNamespace> + <AssemblyName>ConsoleProject</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition="' $(Configuration)' == 'Release' And '$(MsBuildOnTC)' != '' "> + <Foo>Bar</Foo> + </PropertyGroup> + <PropertyGroup Condition="' $(Configuration)' == 'Release' And '$(MsBuildOnTC)' == '' "> + <Foo>Bar</Foo> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>True</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>False</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>True</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> diff --git a/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Program.cs b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Program.cs new file mode 100755 index 0000000000..cd4be63967 --- /dev/null +++ b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Program.cs @@ -0,0 +1,14 @@ +using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ConsoleProject
+{
+ class Program
+ {
+ static void Main (string[] args)
+ {
+ Console.WriteLine ("Hello world");
+ }
+ }
+}
diff --git a/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Properties/AssemblyInfo.cs b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Properties/AssemblyInfo.cs new file mode 100755 index 0000000000..be1e50670d --- /dev/null +++ b/main/tests/test-projects/console-project-custom-configs/ConsoleProject/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle ("ConsoleProject")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("ConsoleProject")]
+[assembly: AssemblyCopyright ("Copyright © 2008")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible (false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid ("a1b85c5f-e506-462a-911c-cbe67c035c93")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyFileVersion ("1.0.0.0")]
diff --git a/main/tests/test-projects/portable-library/ConsoleProject/ConsoleProject.csproj b/main/tests/test-projects/portable-library/ConsoleProject/ConsoleProject.csproj new file mode 100644 index 0000000000..91e2cf1dac --- /dev/null +++ b/main/tests/test-projects/portable-library/ConsoleProject/ConsoleProject.csproj @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{1EA05B11-25A4-45FE-86F7-51641DB93492}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>ConsoleProject</RootNamespace> + <AssemblyName>ConsoleProject</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <Externalconsole>true</Externalconsole> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <ItemGroup> + <ProjectReference Include="..\PortableLibrary\PortableLibrary.csproj"> + <Project>{E54D2645-07DB-4D2C-9507-1AF788E81383}</Project> + <Name>PortableLibrary</Name> + </ProjectReference> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/portable-library/ConsoleProject/Program.cs b/main/tests/test-projects/portable-library/ConsoleProject/Program.cs new file mode 100644 index 0000000000..5fb7739c43 --- /dev/null +++ b/main/tests/test-projects/portable-library/ConsoleProject/Program.cs @@ -0,0 +1,14 @@ +using System; +using PortableLibrary; + +namespace ConsoleProject +{ + class MainClass + { + public static void Main (string[] args) + { + new MyClass (); + Console.WriteLine ("Hello World!"); + } + } +} diff --git a/main/tests/test-projects/portable-library/ConsoleProject/Properties/AssemblyInfo.cs b/main/tests/test-projects/portable-library/ConsoleProject/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..292f0c2522 --- /dev/null +++ b/main/tests/test-projects/portable-library/ConsoleProject/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle ("ConsoleProject")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("Xamarin")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("Xamarin, Inc (http://www.xamarin.com)")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion ("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/main/tests/test-projects/portable-library/PortableLibrary/MyClass.cs b/main/tests/test-projects/portable-library/PortableLibrary/MyClass.cs new file mode 100644 index 0000000000..2efe0a3012 --- /dev/null +++ b/main/tests/test-projects/portable-library/PortableLibrary/MyClass.cs @@ -0,0 +1,12 @@ +using System; + +namespace PortableLibrary +{ + public class MyClass + { + public MyClass () + { + } + } +} + diff --git a/main/tests/test-projects/portable-library/PortableLibrary/PortableLibrary.csproj b/main/tests/test-projects/portable-library/PortableLibrary/PortableLibrary.csproj new file mode 100644 index 0000000000..315b6ab6db --- /dev/null +++ b/main/tests/test-projects/portable-library/PortableLibrary/PortableLibrary.csproj @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <ProjectGuid>{E54D2645-07DB-4D2C-9507-1AF788E81383}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>PortableLibrary</RootNamespace> + <AssemblyName>PortableLibrary</AssemblyName> + <TargetFrameworkProfile>Profile78</TargetFrameworkProfile> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>full</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>false</ConsolePause> + </PropertyGroup> + <ItemGroup> + <Compile Include="MyClass.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/portable-library/PortableLibrary/Properties/AssemblyInfo.cs b/main/tests/test-projects/portable-library/PortableLibrary/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..bb2665bf98 --- /dev/null +++ b/main/tests/test-projects/portable-library/PortableLibrary/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle ("PortableLibrary")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("Xamarin")] +[assembly: AssemblyProduct ("")] +[assembly: AssemblyCopyright ("Xamarin, Inc (http://www.xamarin.com)")] +[assembly: AssemblyTrademark ("")] +[assembly: AssemblyCulture ("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion ("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary1/Class1.cs b/main/tests/test-projects/solution-build-order/ClassLibrary1/Class1.cs new file mode 100755 index 0000000000..39bac4f281 --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary1/Class1.cs @@ -0,0 +1,12 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ClassLibrary1
+{
+ public class Class1
+ {
+ }
+}
diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary1/ClassLibrary1.csproj b/main/tests/test-projects/solution-build-order/ClassLibrary1/ClassLibrary1.csproj new file mode 100644 index 0000000000..422bf8454d --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary1/ClassLibrary1.csproj @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ClassLibrary1</RootNamespace> + <AssemblyName>ClassLibrary1</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary1/Properties/AssemblyInfo.cs b/main/tests/test-projects/solution-build-order/ClassLibrary1/Properties/AssemblyInfo.cs new file mode 100755 index 0000000000..f22105306e --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary1/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ClassLibrary1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ClassLibrary1")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1f9513e0-cbdd-4c38-a233-1bc5fa004f16")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary2/Class1.cs b/main/tests/test-projects/solution-build-order/ClassLibrary2/Class1.cs new file mode 100755 index 0000000000..b88dfa50ba --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary2/Class1.cs @@ -0,0 +1,12 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ClassLibrary2
+{
+ public class Class1
+ {
+ }
+}
diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary2/ClassLibrary2.csproj b/main/tests/test-projects/solution-build-order/ClassLibrary2/ClassLibrary2.csproj new file mode 100644 index 0000000000..47f1ff9db0 --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary2/ClassLibrary2.csproj @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{4562F2C5-5A49-4DD7-9886-ADF59346C2B2}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ClassLibrary2</RootNamespace> + <AssemblyName>ClassLibrary2</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/solution-build-order/ClassLibrary2/Properties/AssemblyInfo.cs b/main/tests/test-projects/solution-build-order/ClassLibrary2/Properties/AssemblyInfo.cs new file mode 100755 index 0000000000..cee280c8f3 --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ClassLibrary2/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ClassLibrary2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ClassLibrary2")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("071ce06c-d64a-4c03-9987-e877c01563f5")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/main/tests/test-projects/solution-build-order/ConsoleApplication3.sln b/main/tests/test-projects/solution-build-order/ConsoleApplication3.sln new file mode 100644 index 0000000000..d9dfe95b00 --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ConsoleApplication3.sln @@ -0,0 +1,58 @@ +
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+VisualStudioVersion = 12.0.30312.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication3", "ConsoleApplication3\ConsoleApplication3.csproj", "{CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2} = {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF} = {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary2", "ClassLibrary2\ClassLibrary2.csproj", "{4562F2C5-5A49-4DD7-9886-ADF59346C2B2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF} = {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ AA BB|Any CPU = AA BB|Any CPU
+ AA'BB|Any CPU = AA'BB|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.AA BB|Any CPU.ActiveCfg = Release|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.AA BB|Any CPU.Build.0 = Release|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.AA'BB|Any CPU.ActiveCfg = Release|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.AA'BB|Any CPU.Build.0 = Release|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4562F2C5-5A49-4DD7-9886-ADF59346C2B2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.AA BB|Any CPU.ActiveCfg = AA BB|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.AA BB|Any CPU.Build.0 = AA BB|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.AA'BB|Any CPU.ActiveCfg = AA'BB|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.AA'BB|Any CPU.Build.0 = AA'BB|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.AA BB|Any CPU.ActiveCfg = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.AA BB|Any CPU.Build.0 = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.AA'BB|Any CPU.ActiveCfg = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.AA'BB|Any CPU.Build.0 = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D98AE4E1-382B-4E3C-8F1D-6DDC469392FF}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = ConsoleApplication3\ConsoleApplication3.csproj
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/main/tests/test-projects/solution-build-order/ConsoleApplication3/App.config b/main/tests/test-projects/solution-build-order/ConsoleApplication3/App.config new file mode 100755 index 0000000000..fad249e406 --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ConsoleApplication3/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+ </startup>
+</configuration>
\ No newline at end of file diff --git a/main/tests/test-projects/solution-build-order/ConsoleApplication3/ConsoleApplication3.csproj b/main/tests/test-projects/solution-build-order/ConsoleApplication3/ConsoleApplication3.csproj new file mode 100644 index 0000000000..025a28acef --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ConsoleApplication3/ConsoleApplication3.csproj @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{CA4A6F5A-71A1-43F0-8611-E9A7A98AB0D7}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ConsoleApplication3</RootNamespace> + <AssemblyName>ConsoleApplication3</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AA BB|AnyCPU'"> + <OutputPath>bin\AA BB\</OutputPath> + <WarningLevel>4</WarningLevel> + <Optimize>false</Optimize> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AA%27BB|AnyCPU'"> + <OutputPath>bin\AA%27BB\</OutputPath> + <WarningLevel>4</WarningLevel> + <Optimize>false</Optimize> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/main/tests/test-projects/solution-build-order/ConsoleApplication3/Program.cs b/main/tests/test-projects/solution-build-order/ConsoleApplication3/Program.cs new file mode 100755 index 0000000000..bc23111caf --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ConsoleApplication3/Program.cs @@ -0,0 +1,23 @@ +using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication3
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ var e = GetNumbers();
+ }
+
+ static IEnumerable<int> GetNumbers()
+ {
+ int n = 0;
+ while (n<1000)
+ yield return n++;
+ }
+ }
+}
diff --git a/main/tests/test-projects/solution-build-order/ConsoleApplication3/Properties/AssemblyInfo.cs b/main/tests/test-projects/solution-build-order/ConsoleApplication3/Properties/AssemblyInfo.cs new file mode 100755 index 0000000000..eb55454daa --- /dev/null +++ b/main/tests/test-projects/solution-build-order/ConsoleApplication3/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConsoleApplication3")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConsoleApplication3")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("52c6bc9f-0c65-4dee-8333-07c84780ae5e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging5.csproj.saved b/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging5.csproj.saved index 850af28e52..81fdfd3321 100644 --- a/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging5.csproj.saved +++ b/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging5.csproj.saved @@ -27,8 +27,5 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <SignAssembly>true</SignAssembly> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <SignAssembly>false</SignAssembly> - </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project> diff --git a/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging6.csproj.saved b/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging6.csproj.saved index 3d7b853db7..fb67e6121b 100644 --- a/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging6.csproj.saved +++ b/main/tests/test-projects/test-configuration-merging/TestConfigurationMerging6.csproj.saved @@ -13,7 +13,6 @@ <DebugSymbols>True</DebugSymbols> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> <DebugType>full</DebugType> - <SignAssembly>false</SignAssembly> </PropertyGroup> <PropertyGroup Condition=" '$(Platform)' == 'x86' "> </PropertyGroup> diff --git a/main/tests/test-projects/unsupported-project/library2/library2.csproj.saved b/main/tests/test-projects/unsupported-project/library2/library2.csproj.saved index 2b7261f704..30e41d06b8 100644 --- a/main/tests/test-projects/unsupported-project/library2/library2.csproj.saved +++ b/main/tests/test-projects/unsupported-project/library2/library2.csproj.saved @@ -19,7 +19,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <Execution> - <Execution clr-version="Net_2_0"/> + <Execution clr-version="Net_2_0" xmlns="" /> </Execution> <ConsolePause>false</ConsolePause> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> @@ -30,7 +30,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <Execution> - <Execution clr-version="Net_2_0" /> + <Execution clr-version="Net_2_0" xmlns="" /> </Execution> <ConsolePause>false</ConsolePause> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> @@ -51,4 +51,4 @@ </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -</Project>
\ No newline at end of file +</Project> |