public void GenerationIsCorrect()
        {
            this.SetupTest("ServicesDependenciesPlatforms");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Submodule.Windows.sln")));

            var moduleContents    = this.ReadFile(@"Module.Windows.sln");
            var submoduleContents = this.ReadFile(@"Submodule\Submodule.Windows.sln");

            _assert.Contains("Console.Windows.csproj", moduleContents);
            _assert.Contains("Library.Windows.csproj", moduleContents);
            _assert.Contains("Library.Windows.csproj", submoduleContents);

            this.Generate("Linux");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Linux.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Module.Linux.sln")));
            _assert.False(File.Exists(this.GetPath(@"Submodule\Library\Library.Linux.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Submodule.Linux.sln")));

            moduleContents    = this.ReadFile(@"Module.Linux.sln");
            submoduleContents = this.ReadFile(@"Submodule\Submodule.Linux.sln");

            _assert.Contains("Console.Linux.csproj", moduleContents);
            _assert.DoesNotContain("Library.Linux.csproj", moduleContents);
            _assert.DoesNotContain("Library.Linux.csproj", submoduleContents);
        }
Esempio n. 2
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("iOSOnWindowsHasAlternatePostBuildHookSystem");

            this.Generate("iOS", hostPlatform: "Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.iOS.csproj")));

            var consoleContents = this.ReadFile(@"Console\Console.iOS.csproj");

            _assert.Contains("LocalTouch Path", consoleContents);

            this.Generate("tvOS", hostPlatform: "Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.tvOS.csproj")));

            consoleContents = this.ReadFile(@"Console\Console.tvOS.csproj");

            _assert.Contains("LocalTouch Path", consoleContents);

            this.Generate("Windows", hostPlatform: "Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));

            consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.DoesNotContain("LocalTouch Path", consoleContents);
        }
Esempio n. 3
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("ServicesEnable");

            this.Generate();

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.False(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            var consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.DoesNotContain("CONSOLE_SERVICE_A;", consoleContents);

            this.Generate(args: "--enable Console/ServiceA");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");
            var libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.Contains("CONSOLE_SERVICE_A;", consoleContents);
            _assert.Contains("LIBRARY_SERVICE_B;", libraryContents);

            this.Generate(args: "--enable Library/ServiceB");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");
            libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.DoesNotContain("CONSOLE_SERVICE_A;", consoleContents);
            _assert.Contains("LIBRARY_SERVICE_B;", libraryContents);
        }
        public void GenerationIsCorrect(string parent, string child)
        {
            this.SetupTest("ExampleCSTools", parent: parent, child: child);

            // Newer versions of Protobuild upgrade this file, but for regression testing we need the old
            // format (it's expected that the old format will be used in conjunction with old versions of
            // Protobuild, which are the version that we're regression testing with).  Copy across
            // the old version before the start of every test here.
            File.Copy(this.GetPath(@"Build\ModuleOldFormat.xml"), this.GetPath(@"Build\Module.xml"), true);
            File.Copy(this.GetPath(@"CSTools\Build\ModuleOldFormat.xml"), this.GetPath(@"CSTools\Build\Module.xml"), true);

            try
            {
                this.Generate();

                _assert.True(File.Exists(this.GetPath(@"Game\Game.Windows.csproj")));
                _assert.True(File.Exists(this.GetPath(@"CSTools\Tool\Tool.Windows.csproj")));

                var gameContents     = this.ReadFile(@"Game\Game.Windows.csproj");
                var solutionContents = this.ReadFile(@"Game.Windows.sln");

                _assert.DoesNotContain("Tool.Windows.csproj", gameContents);
                _assert.Contains("Game.Windows.csproj", solutionContents);
                _assert.Contains("Tool.Windows.csproj", solutionContents);
            }
            finally
            {
                // Reset the module info back to it's original state so we don't have a dirty working copy.
                File.Copy(this.GetPath(@"Build\ModuleOldFormat.xml"), this.GetPath(@"Build\Module.xml"), true);
                File.Copy(this.GetPath(@"CSTools\Build\ModuleOldFormat.xml"), this.GetPath(@"CSTools\Build\Module.xml"), true);
            }
        }
Esempio n. 5
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("CPlusPlusConsoleWorks");

            this.Generate("Windows");

            _assert.True(
                File.Exists(this.GetPath(@"Console\Console.Windows.mdproj")) ||
                File.Exists(this.GetPath(@"Console\Console.Windows.vcxproj")));

            if (File.Exists(this.GetPath(@"Console\Console.Windows.mdproj")))
            {
                var consoleContents = this.ReadFile(@"Console\Console.Windows.mdproj");

                // Looks for various C++ specific configuration values.
                _assert.Contains("main.c", consoleContents);
                _assert.Contains("DefineSymbols", consoleContents);
            }
            else if (File.Exists(this.GetPath(@"Console\Console.Windows.vcxproj")))
            {
                var consoleContents = this.ReadFile(@"Console\Console.Windows.vcxproj");

                // TODO: Validate Visual Studio C++ generated project.
            }
        }
        public void SyncIsCorrect()
        {
            this.SetupTest("SyncDoesNotIncludeContentExtensive");

            // Reset the definition back to it's original version for the test.
            var original = this.GetPath(@"Build\OriginalProjects\HMRQ.definition");
            var target   = this.GetPath(@"Build\Projects\HMRQ.definition");

            File.Copy(original, target, true);

            this.OtherMode("sync", "Windows", purge: false);

            var targetContents = this.ReadFile(@"Build\Projects\HMRQ.definition");

            try
            {
                _assert.Contains("Program.cs", targetContents);
                _assert.Contains("Furnace.cs", targetContents);
                _assert.DoesNotContain(@"..\HMRQ.Content\assets\.source", targetContents);
                _assert.DoesNotContain(@"..\HMRQ.Content\assets\audio\Jump.wav", targetContents);
            }
            finally
            {
                // Reset the file back after the test passes so that Git doesn't
                // report this file as changed.
                File.Copy(original, target, true);
            }
        }
        public void GeneratedTemplateIsCorrect()
        {
            this.SetupTest("PackageTemplateAppliesCorrectly", true);

            // Make sure the Generated directory is removed so we have a clean test every time.
            if (Directory.Exists(this.GetPath("Generated")))
            {
                PathUtils.AggressiveDirectoryDelete(this.GetPath("Generated"));
            }

            Directory.CreateDirectory(GetPath("Generated"));

            var templateFolder = this.SetupSrcTemplate();

            try
            {
                this.OtherMode(
                    "start", "local-template-git://" + templateFolder, workingSubdirectory: "Generated");

                _assert.True(Directory.Exists(GetPath(Path.Combine("Generated", "Generated"))));
                _assert.True(Directory.Exists(GetPath(Path.Combine("Generated", "Generated.Content"))));
                _assert.True(File.Exists(GetPath(Path.Combine("Generated", "Generated", "GeneratedActivity.cs"))));
                _assert.True(File.Exists(GetPath(Path.Combine("Generated", "Generated", "GeneratedGame.cs"))));
                _assert.True(File.Exists(GetPath(Path.Combine("Generated", "Generated", "GeneratedWorld.cs"))));

                var worldFile = ReadFile(Path.Combine("Generated", "Generated", "GeneratedWorld.cs"));

                _assert.Contains("public class GeneratedWorld", worldFile);
                _assert.Contains("Hello Generated!", worldFile);
            }
            finally
            {
                PathUtils.AggressiveDirectoryDelete(templateFolder);
            }
        }
        public void SyncIsCorrect()
        {
            this.SetupTest("SyncDoesNotIncludeContentWorks");

            // Reset the definition back to it's original version for the test.
            var original = this.GetPath(@"Build\OriginalProjects\Console.definition");
            var target   = this.GetPath(@"Build\Projects\Console.definition");

            File.Copy(original, target, true);

            this.OtherMode("sync", "Windows", purge: false);

            var targetContents = this.ReadFile(@"Build\Projects\Console.definition");

            try
            {
                _assert.Contains("Program.cs", targetContents);
                _assert.Contains("Added.cs", targetContents);
                _assert.DoesNotContain("Content", targetContents);
            }
            finally
            {
                // Reset the file back after the test passes so that Git doesn't
                // report this file as changed.
                File.Copy(original, target, true);
            }
        }
Esempio n. 9
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("CPlusPlusDirectReferenceWorks");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(
                File.Exists(this.GetPath(@"Library\Library.Windows.mdproj")) ||
                File.Exists(this.GetPath(@"Library\Library.Windows.vcxproj")));

            var consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");

            if (Path.DirectorySeparatorChar == '/')
            {
                _assert.Contains("libLibrary.so", consoleContents);
            }
            else
            {
                _assert.Contains("Library32.dll", consoleContents);
                _assert.Contains("Library64.dll", consoleContents);
            }

            _assert.Contains("LibraryBinding.dll", consoleContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("NativeBinaryPresent");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));

            var projectContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.Contains("<Link>All</Link>", projectContents);
            _assert.Contains("<Link>Windows.dll</Link>", projectContents);
            _assert.DoesNotContain("<Link>Linux.so</Link>", projectContents);
            _assert.Contains("<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>", projectContents);
            _assert.Contains(@"<None Include=""..\ThirdParty\All"">", projectContents);
            _assert.Contains(@"<None Include=""..\ThirdParty\Windows.dll"">", projectContents);
            _assert.DoesNotContain(@"<None Include=""..\ThirdParty\Linux.so"">", projectContents);

            this.Generate("Linux");

            _assert.True(File.Exists(this.GetPath(@"Module.Linux.sln")));
            _assert.True(File.Exists(this.GetPath(@"Console\Console.Linux.csproj")));

            projectContents = this.ReadFile(@"Console\Console.Linux.csproj");

            _assert.Contains("<Link>All</Link>", projectContents);
            _assert.DoesNotContain("<Link>Windows.dll</Link>", projectContents);
            _assert.Contains("<Link>Linux.so</Link>", projectContents);
            _assert.Contains("<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>", projectContents);
            _assert.Contains(@"<None Include=""..\ThirdParty\All"">", projectContents);
            _assert.DoesNotContain(@"<None Include=""..\ThirdParty\Windows.dll"">", projectContents);
            _assert.Contains(@"<None Include=""..\ThirdParty\Linux.so"">", projectContents);
        }
Esempio n. 11
0
        public void TestFeatureSetIsPackageManagement()
        {
            var module = LoadModuleXml("FeatureSetIsPackageManagement.xml");

            _assert.NotNull(module.FeatureSet);
            _assert.Equal(1, module.FeatureSet.Count);
            _assert.Contains(Feature.PackageManagement, module.FeatureSet);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("PackageLocationParentAndTwoSubmoduleSamePackage");

            var src = this.SetupSrcPackage();

            try
            {
                // Make sure the Package directory is removed so we have a clean test every time.
                if (Directory.Exists(this.GetPath("Package")))
                {
                    PathUtils.AggressiveDirectoryDelete(this.GetPath("Package"));
                }
                if (Directory.Exists(this.GetPath("SubmoduleA\\Package")))
                {
                    PathUtils.AggressiveDirectoryDelete(this.GetPath("SubmoduleA\\Package"));
                }
                if (Directory.Exists(this.GetPath("SubmoduleB\\Package")))
                {
                    PathUtils.AggressiveDirectoryDelete(this.GetPath("SubmoduleB\\Package"));
                }

                this.Generate(args: "--redirect http://protobuild.org/hach-que/TestEmptyPackage local-git://" + src);

                _assert.True(File.Exists(this.GetPath("Package\\PackageLibrary\\PackageLibrary.Windows.csproj")));
                _assert.False(
                    File.Exists(this.GetPath("SubmoduleA\\Package\\PackageLibrary\\PackageLibrary.Windows.csproj")));
                _assert.False(
                    File.Exists(this.GetPath("SubmoduleB\\Package\\PackageLibrary\\PackageLibrary.Windows.csproj")));
                _assert.True(File.Exists(this.GetPath("SubmoduleA\\Package\\.redirect")));
                _assert.True(File.Exists(this.GetPath("SubmoduleB\\Package\\.redirect")));
                _assert.True(File.Exists(this.GetPath("SubmoduleA\\LibraryA\\LibraryA.Windows.csproj")));
                _assert.True(File.Exists(this.GetPath("SubmoduleB\\LibraryB\\LibraryB.Windows.csproj")));

                var consoleContents  = this.ReadFile("Console\\Console.Windows.csproj");
                var libraryAContents = this.ReadFile("SubmoduleA\\LibraryA\\LibraryA.Windows.csproj");
                var libraryBContents = this.ReadFile("SubmoduleB\\LibraryB\\LibraryB.Windows.csproj");

                _assert.Contains(
                    @"Include=""..\Package\PackageLibrary\PackageLibrary.Windows.csproj""",
                    consoleContents);
                _assert.Contains(
                    @"Include=""..\..\Package\PackageLibrary\PackageLibrary.Windows.csproj""",
                    libraryAContents);
                _assert.Contains(
                    @"Include=""..\..\Package\PackageLibrary\PackageLibrary.Windows.csproj""",
                    libraryBContents);
            }
            finally
            {
                PathUtils.AggressiveDirectoryDelete(src);
            }
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("ServicesRecommends");

            this.Generate();

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            var libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.Contains("LIBRARY_SERVICE_B;", libraryContents);

            /*
             * ServiceB is only recommended, so if we explicitly disable it, it should
             * not be present.
             */

            this.Generate(args: "--disable Library/ServiceB");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.DoesNotContain("LIBRARY_SERVICE_B;", libraryContents);

            /*
             * ServiceA conflicts with ServiceB, so ServiceB automatically gets disabled.
             */

            this.Generate(args: "--enable Library/ServiceA");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.DoesNotContain("LIBRARY_SERVICE_B;", libraryContents);

            /*
             * ServiceC has no effect on ServiceB, so ServiceB should be enabled.
             */

            this.Generate(args: "--enable Library/ServiceC");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.Contains("LIBRARY_SERVICE_B;", libraryContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("ServicesRelativeRequire");

            this.Generate();

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));

            var projectContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.Contains("CONSOLE_SERVICE_A;", projectContents);
            _assert.Contains("CONSOLE_SERVICE_B;", projectContents);
        }
        public void PackageIsCorrect()
        {
            this.SetupTest("PackageFilterCorrectModuleXml", isPackTest: true);

            this.OtherMode("pack", args: ". Windows.tar.lzma Windows Filter.Windows.txt", purge: false);

            var packagedFiles = this.LoadPackage("Windows.tar.lzma");

            _assert.Contains("Build/", packagedFiles.Keys);
            _assert.Contains("Build/Module.xml", packagedFiles.Keys);
            _assert.Contains("Build/Projects/", packagedFiles.Keys);
            _assert.Contains("Build/Projects/Console.definition", packagedFiles.Keys);
            _assert.Equal(4, packagedFiles.Count);
        }
Esempio n. 16
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("NuGetAndroidDoesNotCrash");

            this.Generate("Android");

            _assert.True(File.Exists(this.GetPath(@"Module.Android.sln")));
            _assert.True(File.Exists(this.GetPath(@"Console\Console.Android.csproj")));

            var consoleContents = this.ReadFile(@"Console\Console.Android.csproj");

            _assert.Contains("MonoAndroid10", consoleContents);
            _assert.Contains("MonoAndroid403", consoleContents);
            _assert.Contains("MonoAndroid41", consoleContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("iOSLegacyAPIGenerationWorks");

            this.Generate("iOS");

            _assert.True(File.Exists(this.GetPath(@"App\App.iOS.csproj")));

            var appContents = this.ReadFile(@"App\App.iOS.csproj");

            _assert.DoesNotContain(@"Xamarin.iOS", appContents);
            _assert.DoesNotContain(@"$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets", appContents);
            _assert.Contains(@"monotouch", appContents);
            _assert.Contains(@"$(MSBuildToolsPath)\Microsoft.CSharp.targets", appContents);
        }
Esempio n. 18
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("ServicesCrossProjectRequire");

            this.Generate();

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"Submodule\Library\Library.Windows.csproj")));

            var consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");
            var libraryContents = this.ReadFile(@"Submodule\Library\Library.Windows.csproj");

            _assert.Contains("CONSOLE_SERVICE_A;", consoleContents);
            _assert.Contains("LIBRARY_SERVICE_B;", libraryContents);
        }
Esempio n. 19
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("NuGetPortableLibraryDetectedWithRootPathDot");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
            _assert.True(File.Exists(this.GetPath(@"Console.Windows.csproj")));

            var consoleContents = this.ReadFile(@"Console.Windows.csproj");

            _assert.Contains("portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid", consoleContents);
            _assert.Contains("Test.dll", consoleContents);
            _assert.Contains("<HintPath>packages", consoleContents);
            _assert.DoesNotContain("<HintPath>..\\packages", consoleContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("ExcludeAttributeOnItemsSynchronisedCorrectly");

            // Reset the definition back to it's original version for the test.
            var original = this.GetPath(@"Build\OriginalProjects\Console.definition");
            var target   = this.GetPath(@"Build\Projects\Console.definition");

            File.Copy(original, target, true);

            this.OtherMode("sync", "Windows", purge: false);

            var targetContents = this.ReadFile(@"Build\Projects\Console.definition");

            try
            {
                _assert.Contains("Exclude=\"Program.cs\"", targetContents);
            }
            finally
            {
                // Reset the file back after the test passes so that Git doesn't
                // report this file as changed.
                File.Copy(original, target, true);
            }
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("ProjectSpecificOutputFolder");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"ConsoleA\ConsoleA.Windows.csproj")));
            _assert.True(File.Exists(this.GetPath(@"ConsoleB\ConsoleB.Windows.csproj")));

            var consoleAContents = this.ReadFile(@"ConsoleA\ConsoleA.Windows.csproj");
            var consoleBContents = this.ReadFile(@"ConsoleB\ConsoleB.Windows.csproj");

            _assert.Contains("<OutputPath>bin\\Windows\\AnyCPU\\Debug</OutputPath>", consoleAContents);
            _assert.DoesNotContain("<OutputPath>bin\\ConsoleA\\Windows\\AnyCPU\\Debug</OutputPath>", consoleAContents);
            _assert.Contains("<OutputPath>bin\\ConsoleB\\Windows\\AnyCPU\\Debug</OutputPath>", consoleBContents);
            _assert.DoesNotContain("<OutputPath>bin\\Windows\\AnyCPU\\Debug</OutputPath>", consoleBContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("MacOSPlatformForceAPIXamMacWorks");

            var @out = this.Generate("MacOS", capture: true);

            var appPath = this.GetPath("App\\App.MacOS.csproj");

            _assert.True(File.Exists(appPath));

            var appContents = this.ReadFile(appPath);

            _assert.Contains("<Reference Include=\"XamMac\"", appContents);
            _assert.Contains("{42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23}", appContents);
            _assert.DoesNotContain("Xamarin.Mac.CSharp.targets", appContents);
            _assert.Contains("PLATFORM_MACOS_LEGACY", appContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("IncludeProjectViaExternalWorks");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
            _assert.False(File.Exists(this.GetPath(@"Includable\Includable.Windows.csproj")));

            var projectContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.Contains("<Link>Included Code\\Includable\\MyIncludableClass.cs</Link>", projectContents);
            _assert.Contains("<FromIncludeProject>", projectContents);
            _assert.Contains("..\\Includable\\MyIncludableClass.cs", projectContents);
            _assert.DoesNotContain("<Reference Include=\"Includable\" />", projectContents);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("MacOSPlatformForceAPIMonoMacWorks");

            var @out = this.Generate("MacOS", capture: true);

            var appPath = this.GetPath("App\\App.MacOS.csproj");

            _assert.True(File.Exists(appPath));

            var appContents = this.ReadFile(appPath);

            _assert.Contains("<Reference Include=\"MonoMac\"", appContents);
            _assert.Contains("{948B3504-5B70-4649-8FE4-BDE1FB46EC69}", appContents);
            _assert.DoesNotContain("Xamarin.Mac.CSharp.targets", appContents);
            _assert.Contains("PLATFORM_MACOS_LEGACY", appContents);
        }
Esempio n. 25
0
        public void SyncIsCorrect()
        {
            this.SetupTest("SubmoduleSynchronisationSkippedIfNoStandardProjects");

            var output = this.OtherMode("sync", capture: true);

            _assert.Contains("Skipping submodule synchronisation for Submodule (there are no projects to synchronise)", output.Item1);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("SubmodulePackageResolutionSkippedIfNoPackagesOrSubmodules");

            var output = this.Generate(capture: true);

            _assert.Contains("Skipping package resolution in submodule for Submodule (there are no submodule or packages)", output.Item1);
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("MacOSPlatformForceAPIXamarinMacWorks");

            var @out = this.Generate("MacOS", capture: true);

            var appPath = this.GetPath("App\\App.MacOS.csproj");

            _assert.True(File.Exists(appPath));

            var appContents = this.ReadFile(appPath);

            _assert.Contains("<Reference Include=\"Xamarin.Mac\"", appContents);
            _assert.Contains("{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1}", appContents);
            _assert.Contains("Xamarin.Mac.CSharp.targets", appContents);
            _assert.DoesNotContain("PLATFORM_MACOS_LEGACY", appContents);
        }
Esempio n. 28
0
        public void GenerationIsCorrect()
        {
            this.SetupTest("FeatureWarningIsShownWhenPreviousFeatureIsMissing");

            var output = this.Generate(capture: true);

            _assert.Contains("WARNING: The active feature set is missing previous features!", output.Item2);
        }
Esempio n. 29
0
        public void PackageIsCorrect()
        {
            this.SetupTest("PackageAutomaticDoesNotCopyIncludeReference", isPackTest: true);

            this.OtherMode("pack", args: ". Windows.tar.lzma Windows", purge: false);

            var packagedFiles = this.LoadPackage("Windows.tar.lzma");

            _assert.Contains("Build/", packagedFiles.Keys);
            _assert.Contains("Build/Module.xml", packagedFiles.Keys);
            _assert.Contains("Build/Projects/", packagedFiles.Keys);
            _assert.Contains("Build/Projects/ExternalProject.definition", packagedFiles.Keys);
            _assert.Contains("Build/Projects/IncludeProject.definition", packagedFiles.Keys);
            _assert.Contains("Build/Projects/StandardProject.definition", packagedFiles.Keys);

            using (var stream = new MemoryStream(packagedFiles["Build/Projects/StandardProject.definition"]))
            {
                using (var reader = new StreamReader(stream))
                {
                    var content = reader.ReadToEnd();

                    _assert.Contains("ExternalProject", content);
                    _assert.DoesNotContain("IncludeProject", content);
                }
            }
        }
        public void GenerationIsCorrect()
        {
            this.SetupTest("ExternalProjectReferencesAreFlattened");

            this.Generate("Windows");

            _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));

            var consoleContents = this.ReadFile(@"Console\Console.Windows.csproj");

            _assert.DoesNotContain("ExternalA", consoleContents);
            _assert.DoesNotContain("ExternalB", consoleContents);
            _assert.DoesNotContain("ExternalC", consoleContents);
            _assert.DoesNotContain("ExternalD", consoleContents);
            _assert.DoesNotContain("ExternalE", consoleContents);
            _assert.Contains("ExpectedTargetMet", consoleContents);
            _assert.Contains("ExpectedPlatformTargetMet", consoleContents);
        }