Exemple #1
0
        public bool Build(StringBuilder output = null)
        {
            Console.WriteLine("------------- Building Application -------------");
            SynchronizeAll();
            var nugetResult = Nuget.Restore(projectDirectory);

            if (nugetResult != 0)
            {
                Console.WriteLine("NuGet exited with code: {0}", nugetResult);
            }
            return(buildSystem.Execute(BuildAction.Build, output) == 0);
        }
Exemple #2
0
        public static string RunTangerine()
        {
            const string projectName      = "Tangerine";
            var          projectDirectory = Path.Combine(Toolbox.CalcCitrusDirectory(), projectName);

#if WIN
            var solutionPath = Path.Combine(projectDirectory, projectName + ".Win.sln");
            MSBuild.TryGetMSBuildPath(out var msbuildPath);
            Nuget.Restore(solutionPath, msbuildPath);
            var solutionBuilder = new SolutionBuilder(
                TargetPlatform.Win,
                solutionPath,
                BuildConfiguration.Release);
#elif MAC
            var solutionPath = Path.Combine(projectDirectory, projectName + ".Win.sln");
            Nuget.Restore(solutionPath);
            var solutionBuilder = new SolutionBuilder(
                TargetPlatform.Mac,
                solutionPath,
                BuildConfiguration.Debug);                 // RELEASE requires code signing, use debug for a while.
#endif
            if (!solutionBuilder.Build())
            {
                return("Build system has returned error");
            }

            var p = new System.Diagnostics.Process();
#if WIN
            p.StartInfo.FileName = Path.Combine(
                projectDirectory,
                "Tangerine",
                "bin",
                BuildConfiguration.Release,
                "Tangerine.exe");
#elif MAC
            p.StartInfo.FileName = Path.Combine(
                projectDirectory,
                "Tangerine",
                "bin",
                BuildConfiguration.Debug,
                "Tangerine.app/Contents/MacOS/Tangerine");
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.EnvironmentVariables.Clear();
            p.StartInfo.EnvironmentVariables.Add("PATH", "/usr/bin");
#endif
            p.Start();
            return(null);
        }